MCPcopy Index your code
hub / github.com/bpython/bpython / delete_rest_of_word

Function delete_rest_of_word

bpython/curtsiesfrontend/manual_readline.py:266–274  ·  view source on GitHub ↗
(cursor_offset, line)

Source from the content-addressed store, hash-verified

264@edit_keys.on("<Esc+d>") # option-d
265@kills_ahead
266def 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
277delete_word_to_cursor_re = LazyReCompile(r"\s\S")

Callers

nothing calls this directly

Calls 2

searchMethod · 0.80
startMethod · 0.80

Tested by

no test coverage detected