1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-08-08 18:40:37 +02:00

Immutable isRecording inside handleKey()

This commit is contained in:
Andrey Vlasovskikh 2012-10-17 15:49:35 +04:00
parent 0872a0c3b5
commit 03bbc2e1f2

View File

@ -103,8 +103,8 @@ public class KeyHandler {
// Be careful: all the EditorActionHandler implementation should correctly process InjectedEditors
editor = InjectedLanguageUtil.getTopLevelEditor(editor);
logger.debug("handleKey " + key);
CommandState editorState = CommandState.getInstance(editor);
boolean isRecording = editorState.isRecording();
final CommandState editorState = CommandState.getInstance(editor);
final boolean isRecording = editorState.isRecording();
boolean shouldRecord = true;
for (int loop = 0; loop < 2; loop++) {
// If this is a "regular" character keystroke, get the character
@ -330,9 +330,7 @@ public class KeyHandler {
// handle the argument
if (currentArg != Argument.NONE) {
partialReset(editor);
boolean saveRecording = isRecording;
handleKey(editor, key, context);
isRecording = saveRecording;
shouldRecord = false; // Prevent this from getting recorded twice
}
}