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

Method get_last_word

bpython/curtsiesfrontend/repl.py:880–891  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

878 self.add_normal_character(e)
879
880 def get_last_word(self):
881 previous_word = _last_word(self.rl_history.entry)
882 word = _last_word(self.rl_history.back())
883 line = self.current_line
884 self._set_current_line(
885 line[: len(line) - len(previous_word)] + word,
886 reset_rl_history=False,
887 )
888 self._set_cursor_offset(
889 self.cursor_offset - len(previous_word) + len(word),
890 reset_rl_history=False,
891 )
892
893 def incremental_search(self, reverse=False, include_current=False):
894 if self.incr_search_mode == SearchMode.NO_SEARCH:

Callers 3

process_key_eventMethod · 0.95
test_get_last_wordMethod · 0.80

Calls 4

_set_current_lineMethod · 0.95
_set_cursor_offsetMethod · 0.95
_last_wordFunction · 0.85
backMethod · 0.80

Tested by 2

test_get_last_wordMethod · 0.64