From 9533aaf4583e213a6b1a010c8f8d5cabdc6e0fc0 Mon Sep 17 00:00:00 2001 From: aioute Gao Date: Thu, 14 Apr 2016 08:46:54 +0900 Subject: [PATCH] Address #22. --- src/Actions/Find.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Actions/Find.ts b/src/Actions/Find.ts index e0b6b925..65215d5d 100644 --- a/src/Actions/Find.ts +++ b/src/Actions/Find.ts @@ -6,7 +6,7 @@ export class ActionFind { return commands.executeCommand('actions.find'); } - // TODO: Implement independent find function to avoid visual flashing. + // TODO: Implement independent find function to avoid incorrect cursor position after `next()` static byIndicator(): Thenable { const activeTextEditor = window.activeTextEditor; @@ -29,8 +29,8 @@ export class ActionFind { return commands.executeCommand('editor.action.nextMatchFindAction') .then(() => { - activeTextEditor.selection = new Selection(activeTextEditor.selection.start, activeTextEditor.selection.start); - window.showTextDocument(activeTextEditor.document); + window.showTextDocument(activeTextEditor.document, activeTextEditor.viewColumn); + activeTextEditor.selection = new Selection(activeTextEditor.selection.end, activeTextEditor.selection.end); return Promise.resolve(true); }); } @@ -44,8 +44,8 @@ export class ActionFind { return commands.executeCommand('editor.action.previousMatchFindAction') .then(() => { + window.showTextDocument(activeTextEditor.document, activeTextEditor.viewColumn); activeTextEditor.selection = new Selection(activeTextEditor.selection.start, activeTextEditor.selection.start); - window.showTextDocument(activeTextEditor.document); return Promise.resolve(true); }); }