Skip to content

Commit

Permalink
Fix search mode, and add tests so this doesn't happen again.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfn committed Jun 19, 2016
1 parent 418bb8d commit 208c37d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Vim",
"description": "Vim emulation for Visual Studio Code",
"icon": "images/icon.png",
"version": "0.0.22",
"version": "0.0.23",
"publisher": "vscodevim",
"galleryBanner": {
"color": "#a5c9a2",
Expand Down
4 changes: 4 additions & 0 deletions src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ export class ModeHandler implements vscode.Disposable {
return;
}

if (this._vimState.currentMode === ModeName.SearchInProgressMode) {
return;
}

// See comment about justUpdatedState.
if (this._vimState.justUpdatedState && (
this._vimState.currentMode === ModeName.Visual ||
Expand Down
34 changes: 34 additions & 0 deletions test/mode/modeNormal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,4 +449,38 @@ suite("Mode Normal", () => {
end: ['one', 'two', '|two']
});

newTest({
title: "Can run a basic search",
start: ['|one two three'],
keysPressed: '/thr\n',
end: ['one two |three'],
});

newTest({
title: "Can run a basic search",
start: ['|one two three'],
keysPressed: '/thr\n',
end: ['one two |three'],
});

newTest({
title: "Can run a basic search",
start: ['|one two two two'],
keysPressed: '/two\nn',
end: ['one two |two two'],
});

newTest({
title: "Can run a basic search",
start: ['one two thre|e'],
keysPressed: '?two\n',
end: ['one |two three'],
});

newTest({
title: "Can run a basic search",
start: ['one two two thre|e'],
keysPressed: '?two\nn',
end: ['one |two two three'],
});
});

0 comments on commit 208c37d

Please # to comment.