Skip to content

Commit

Permalink
Merge pull request #931 from xconverge/repeat-search
Browse files Browse the repository at this point in the history
fixes #652
  • Loading branch information
rebornix authored Oct 18, 2016
2 parents c20a663 + d7321e1 commit d1bb526
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 === "") {
Expand All @@ -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 === "<Esc>") {
vimState.currentMode = ModeName.Normal;
Expand Down

0 comments on commit d1bb526

Please sign in to comment.