Skip to content

Commit

Permalink
control key not store in edit command buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
nakagami committed Aug 25, 2024
1 parent 7ac11af commit 2e6a7cb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyvim/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from prompt_toolkit.filters import Condition
from prompt_toolkit.history import FileHistory
from prompt_toolkit.key_binding.vi_state import InputMode
from prompt_toolkit.key_binding.bindings.vi import Keys
from prompt_toolkit.styles import DynamicStyle

from .commands.completer import create_command_completer
Expand Down Expand Up @@ -349,10 +350,12 @@ def start_edit_command(self, event=None):
logger.debug(f"start_edit_command():{self.application.vi_state.input_mode}:{event}")
logger.debug(self._last_edit_command)

def append_edit_command(self, key):
def append_edit_command(self, key_event):
if self._in_edit_command:
self._last_edit_command.append(key)
logger.debug(f"append_edit_command():{self.application.vi_state.input_mode}:{key}")
if key_event.key in (Keys.ControlG, Keys.ControlP, Keys.ControlN):
return
self._last_edit_command.append(key_event)
logger.debug(f"append_edit_command():{self.application.vi_state.input_mode}:{key_event}")
logger.debug(self._last_edit_command)

def finish_edit_command(self, event=None):
Expand Down

0 comments on commit 2e6a7cb

Please sign in to comment.