MCPcopy Create free account
hub / github.com/ipython/ipython / reformat_text_before_cursor

Function reformat_text_before_cursor

IPython/terminal/shortcuts.py:98–104  ·  view source on GitHub ↗
(buffer, document, shell)

Source from the content-addressed store, hash-verified

96
97
98def reformat_text_before_cursor(buffer, document, shell):
99 text = buffer.delete_before_cursor(len(document.text[:document.cursor_position]))
100 try:
101 formatted_text = shell.reformat_handler(text)
102 buffer.insert_text(formatted_text)
103 except Exception as e:
104 buffer.insert_text(text)
105
106
107def newline_or_execute_outer(shell):

Callers 2

reformat_and_executeFunction · 0.85
newline_or_executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected