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

Method keyboard_interrupt

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

Source from the content-addressed store, hash-verified

1315 self.cursor_offset = len(self.current_line)
1316
1317 def keyboard_interrupt(self):
1318 # TODO factor out the common cleanup from running a line
1319 self.cursor_offset = -1
1320 self.unhighlight_paren()
1321 self.display_lines.extend(self.display_buffer_lines)
1322 self.display_lines.extend(
1323 paint.display_linize(self.current_cursor_line, self.width)
1324 )
1325 self.display_lines.extend(
1326 paint.display_linize("KeyboardInterrupt", self.width)
1327 )
1328 self.clear_current_block(remove_from_history=False)
1329
1330 def unhighlight_paren(self):
1331 """Modify line in self.display_buffer to unhighlight a paren if

Callers 1

process_control_eventMethod · 0.95

Calls 2

unhighlight_parenMethod · 0.95
clear_current_blockMethod · 0.95

Tested by

no test coverage detected