Skip to content

Commit

Permalink
CtrlE cancel completion. fix #55
Browse files Browse the repository at this point in the history
  • Loading branch information
nakagami committed Oct 7, 2024
1 parent 2ebd281 commit a803c48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyvim/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
- Ctrl+n: select next candidate
- Ctrl+p: select previsous candidate
- Ctrl+g: close autocompletion window
- Ctrl+g,Ctrl+y: accept and close autocompletion window
- Ctrl+e: cancen completion and close autocompletion window
This key binding may change in the future.
Expand Down
7 changes: 7 additions & 0 deletions pyvim/key_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,13 @@ def _unindent(event):
buffer.cursor_position = cursor_position - 1
break

@kb.add("c-e", filter=vi_insert_mode)
def _cancel_completion(event: E) -> None:
"""
Cancel completion. Go back to originally typed text.
"""
event.current_buffer.cancel_completion()

@kb.add("enter", filter=in_insert_mode & is_multiline)
def _newline(event: E) -> None:
"""
Expand Down

0 comments on commit a803c48

Please sign in to comment.