From e36190e52803a97ad901e14263cb930e3d7a7469 Mon Sep 17 00:00:00 2001 From: reujab Date: Tue, 10 Jul 2018 21:10:38 -0400 Subject: [PATCH 1/2] workaround surround bug --- src/actions/plugins/surround.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/actions/plugins/surround.ts b/src/actions/plugins/surround.ts index 3bebaa7f21f..d0b40dd5882 100644 --- a/src/actions/plugins/surround.ts +++ b/src/actions/plugins/surround.ts @@ -347,6 +347,10 @@ export class CommandSurroundAddToReplacement extends BaseCommand { vimState.recordedState.surroundKeys.push(vimState.keyHistory[i]); } + // When deleting surroundings, handled == false. This workaround + // resets the command list anyway. + vimState.recordedState.resetCommandList(); + return false; } From 95122a313c85c0aaef339712575f37f9fc1d4e74 Mon Sep 17 00:00:00 2001 From: reujab Date: Fri, 20 Jul 2018 00:15:55 -0400 Subject: [PATCH 2/2] properly fix surround bug --- src/actions/plugins/surround.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/actions/plugins/surround.ts b/src/actions/plugins/surround.ts index d0b40dd5882..79475b18846 100644 --- a/src/actions/plugins/surround.ts +++ b/src/actions/plugins/surround.ts @@ -85,7 +85,9 @@ class CommandSurroundAddTarget extends BaseCommand { } // It's possible we're already done, e.g. dst - await CommandSurroundAddToReplacement.TryToExecuteSurround(vimState, position); + if (await CommandSurroundAddToReplacement.TryToExecuteSurround(vimState, position)) { + this.isCompleteAction = true; + } return vimState; } @@ -326,7 +328,9 @@ export class CommandSurroundAddToReplacement extends BaseCommand { vimState.surround.replacement += stringToAdd; - await CommandSurroundAddToReplacement.TryToExecuteSurround(vimState, position); + if (await CommandSurroundAddToReplacement.TryToExecuteSurround(vimState, position)) { + this.isCompleteAction = true; + } return vimState; } @@ -347,11 +351,7 @@ export class CommandSurroundAddToReplacement extends BaseCommand { vimState.recordedState.surroundKeys.push(vimState.keyHistory[i]); } - // When deleting surroundings, handled == false. This workaround - // resets the command list anyway. - vimState.recordedState.resetCommandList(); - - return false; + return true; } // we assume that we start directly on the characters we're operating over