From 962cfb7ae2c230957645d1dd6b0dbf329f84f14f Mon Sep 17 00:00:00 2001 From: run Date: Thu, 16 Apr 2020 15:45:57 +0800 Subject: [PATCH] [VIM-1991] fix >0 number register not work --- src/com/maddyhome/idea/vim/KeyHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/maddyhome/idea/vim/KeyHandler.java b/src/com/maddyhome/idea/vim/KeyHandler.java index 62eff3f499..258ff17a19 100644 --- a/src/com/maddyhome/idea/vim/KeyHandler.java +++ b/src/com/maddyhome/idea/vim/KeyHandler.java @@ -563,7 +563,9 @@ private boolean handleAbandonedMappingSequence(@NotNull Editor editor, private boolean isCommandCountKey(char chKey, @NotNull CommandState editorState) { // Make sure to avoid handling '0' as the start of a count. final CommandBuilder commandBuilder = editorState.getCommandBuilder(); - return (editorState.getMode() == CommandState.Mode.COMMAND || editorState.getMode() == CommandState.Mode.VISUAL) + return ((editorState.getMode() == CommandState.Mode.COMMAND + &&editorState.getSubMode()!=CommandState.SubMode.REGISTER_PENDING) + || editorState.getMode() == CommandState.Mode.VISUAL) && commandBuilder.isExpectingCount() && Character.isDigit(chKey) && (commandBuilder.getCount() > 0 || chKey != '0'); }