diff --git a/src/actions/actions.ts b/src/actions/actions.ts index 30a3cbca0bd..75bf8d4e565 100644 --- a/src/actions/actions.ts +++ b/src/actions/actions.ts @@ -1208,7 +1208,6 @@ class CommandInsertInSearchMode extends BaseCommand { searchState.searchString = searchState.searchString.slice(0, -1); } else if (key === "\n") { vimState.currentMode = ModeName.Normal; - vimState.cursorPosition = searchState.getNextSearchMatchPosition(vimState.cursorPosition).pos; // Repeat the previous search if no new string is entered if (searchState.searchString === "") { @@ -1220,6 +1219,9 @@ class CommandInsertInSearchMode extends BaseCommand { // Store this search vimState.searchStatePrevious = searchState; + // Move cursor to next match + vimState.cursorPosition = searchState.getNextSearchMatchPosition(vimState.cursorPosition).pos; + return vimState; } else if (key === "") { vimState.currentMode = ModeName.Normal;