Fix search mode, and add tests so this doesn't happen again.

This commit is contained in:
johnfn 2016-06-18 23:52:41 -07:00
parent 418bb8d912
commit 208c37d6f9
3 changed files with 39 additions and 1 deletions

View File

@ -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",

View File

@ -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 ||

View File

@ -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'],
});
});