MCPcopy Index your code
hub / github.com/prompt-toolkit/ptpython / at_the_end

Function at_the_end

src/ptpython/key_bindings.py:169–173  ·  view source on GitHub ↗

we consider the cursor at the end when there is no text after the cursor, or only whitespace.

(b: Buffer)

Source from the content-addressed store, hash-verified

167 empty_lines_required = python_input.accept_input_on_enter or 10000
168
169 def at_the_end(b: Buffer) -> bool:
170 """we consider the cursor at the end when there is no text after
171 the cursor, or only whitespace."""
172 text = b.document.text_after_cursor
173 return text == "" or (text.isspace() and "\n" not in text)
174
175 if python_input.paste_mode:
176 # In paste mode, always insert text.

Callers 1

_Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected