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

Method on_enter

bpython/curtsiesfrontend/repl.py:942–953  ·  view source on GitHub ↗
(self, new_code=True, reset_rl_history=True)

Source from the content-addressed store, hash-verified

940 self.cut_buffer = cut
941
942 def on_enter(self, new_code=True, reset_rl_history=True):
943 # so the cursor isn't touching a paren TODO: necessary?
944 if new_code:
945 self.redo_stack = []
946
947 self._set_cursor_offset(-1, update_completion=False)
948 if reset_rl_history:
949 self.rl_history.reset()
950
951 self.history.append(self.current_line)
952 self.all_logical_lines.append((self.current_line, LineType.INPUT))
953 self.push(self.current_line, insert_into_history=new_code)
954
955 def on_tab(self, back=False):
956 """Do something on tab key

Callers 10

process_key_eventMethod · 0.95
operate_and_get_nextMethod · 0.95
reevaluateMethod · 0.95
test_run_lineMethod · 0.80
enterMethod · 0.80
test_472Method · 0.80
pushMethod · 0.80

Calls 4

_set_cursor_offsetMethod · 0.95
pushMethod · 0.95
appendMethod · 0.80
resetMethod · 0.45

Tested by 6

test_run_lineMethod · 0.64
enterMethod · 0.64
test_472Method · 0.64
pushMethod · 0.64