(cursor_offset, line)
| 264 | @edit_keys.on("<Esc+d>") # option-d |
| 265 | @kills_ahead |
| 266 | def delete_rest_of_word(cursor_offset, line): |
| 267 | m = delete_rest_of_word_re.search(line[cursor_offset:]) |
| 268 | if not m: |
| 269 | return cursor_offset, line, "" |
| 270 | return ( |
| 271 | cursor_offset, |
| 272 | line[:cursor_offset] + line[m.start() + cursor_offset + 1 :], |
| 273 | line[cursor_offset : m.start() + cursor_offset + 1], |
| 274 | ) |
| 275 | |
| 276 | |
| 277 | delete_word_to_cursor_re = LazyReCompile(r"\s\S") |