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

Method input_auto_indent

Lib/pdb.py:791–803  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

789 return
790
791 def input_auto_indent():
792 last_index = readline.get_current_history_length()
793 last_line = readline.get_history_item(last_index)
794 if last_line:
795 if last_line.isspace():
796 # If the last line is empty, we don't need to indent
797 return
798
799 last_line = last_line.rstrip('\r\n')
800 indent = len(last_line) - len(last_line.lstrip())
801 if last_line.endswith(":"):
802 indent += 4
803 readline.insert_text(' ' * indent)
804
805 completenames = self.completenames
806 try:

Callers

nothing calls this directly

Calls 7

get_history_itemMethod · 0.80
isspaceMethod · 0.80
insert_textMethod · 0.80
rstripMethod · 0.45
lstripMethod · 0.45
endswithMethod · 0.45

Tested by

no test coverage detected