MCPcopy Index your code
hub / github.com/python/cpython / autocomplete_event

Method autocomplete_event

Lib/idlelib/autocomplete.py:70–82  ·  view source on GitHub ↗

(tab) Complete word or open list if multiple options.

(self, event)

Source from the content-addressed store, hash-verified

68 return "break"
69
70 def autocomplete_event(self, event):
71 "(tab) Complete word or open list if multiple options."
72 if hasattr(event, "mc_state") and event.mc_state or\
73 not self.text.get("insert linestart", "insert").strip():
74 # A modifier was pressed along with the tab or
75 # there is only previous whitespace on this line, so tab.
76 return None
77 if self.autocompletewindow and self.autocompletewindow.is_active():
78 self.autocompletewindow.complete()
79 return "break"
80 else:
81 opened = self.open_completions(TAB)
82 return "break" if opened else None
83
84 def try_open_completions_event(self, event=None):
85 "(./) Open completion list after pause with no movement."

Callers 1

Calls 5

open_completionsMethod · 0.95
stripMethod · 0.45
getMethod · 0.45
is_activeMethod · 0.45
completeMethod · 0.45

Tested by 1