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

Method on_input_change

bpython/urwid.py:1000–1011  ·  view source on GitHub ↗
(self, edit, text)

Source from the content-addressed store, hash-verified

998 self.frame.body = self.listbox
999
1000 def on_input_change(self, edit, text):
1001 # TODO: we get very confused here if "text" contains newlines,
1002 # so we cannot put our edit widget in multiline mode yet.
1003 # That is probably fixable...
1004 tokens = self.tokenize(text, False)
1005 edit.set_edit_markup(list(format_tokens(tokens)))
1006 if not self._completion_update_suppressed:
1007 # If we call this synchronously the get_edit_text() in repl.cw
1008 # still returns the old text...
1009 self.main_loop.set_alarm_in(
1010 0, lambda *args: self._populate_completion()
1011 )
1012
1013 def on_edit_pos_changed(self, edit, position):
1014 """Gets called when the cursor position inside the edit changed.

Callers

nothing calls this directly

Calls 4

_populate_completionMethod · 0.95
format_tokensFunction · 0.85
tokenizeMethod · 0.80
set_edit_markupMethod · 0.80

Tested by

no test coverage detected