Whatever my option-delete does in bash on my mac
(cursor_offset, line)
| 355 | @edit_keys.on("<Meta-BACKSPACE>") |
| 356 | @kills_behind |
| 357 | def delete_word_from_cursor_back(cursor_offset, line): |
| 358 | """Whatever my option-delete does in bash on my mac""" |
| 359 | if not line: |
| 360 | return cursor_offset, line, "" |
| 361 | start = None |
| 362 | for match in delete_word_from_cursor_back_re.finditer(line): |
| 363 | if match.start() < cursor_offset: |
| 364 | start = match.start() |
| 365 | if start is not None: |
| 366 | return ( |
| 367 | start, |
| 368 | line[:start] + line[cursor_offset:], |
| 369 | line[start:cursor_offset], |
| 370 | ) |
| 371 | else: |
| 372 | return cursor_offset, line, "" |