Accept autosuggestion and keep cursor in place
(event: KeyPressEvent)
| 510 | |
| 511 | |
| 512 | def accept_and_keep_cursor(event: KeyPressEvent): |
| 513 | """Accept autosuggestion and keep cursor in place""" |
| 514 | buffer = event.current_buffer |
| 515 | old_position = buffer.cursor_position |
| 516 | suggestion = buffer.suggestion |
| 517 | if suggestion: |
| 518 | buffer.insert_text(suggestion.text) |
| 519 | buffer.cursor_position = old_position |
| 520 | |
| 521 | |
| 522 | def accept_and_move_cursor_left(event: KeyPressEvent): |
no outgoing calls
searching dependent graphs…