MCPcopy Index your code
hub / github.com/ipython/ipython / accept_or_jump_to_end

Function accept_or_jump_to_end

IPython/terminal/shortcuts/auto_suggest.py:463–474  ·  view source on GitHub ↗

Apply autosuggestion or jump to end of line.

(event: KeyPressEvent)

Source from the content-addressed store, hash-verified

461
462
463def accept_or_jump_to_end(event: KeyPressEvent):
464 """Apply autosuggestion or jump to end of line."""
465 buffer = event.current_buffer
466 d = buffer.document
467 after_cursor = d.text[d.cursor_position :]
468 lines = after_cursor.split("\n")
469 end_of_current_line = lines[0].strip()
470 suggestion = buffer.suggestion
471 if (suggestion is not None) and (suggestion.text) and (end_of_current_line == ""):
472 buffer.insert_text(suggestion.text)
473 else:
474 nc.end_of_line(event)
475
476
477def accept(event: KeyPressEvent):

Callers 1

test_autosuggest_at_EOLFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_autosuggest_at_EOLFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…