diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts index 155a383f5c45c15831944123da32e248f48407c0..3aa3e4b18255e0ddabc5f35e1bea7d365dcc6137 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts @@ -236,7 +236,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC this.toUnhook.push(this.editor.onKeyDown((e: IKeyboardEvent) => this.onEditorKeyDown(e))); this.toUnhook.push(this.editor.onKeyUp((e: IKeyboardEvent) => this.onEditorKeyUp(e))); - this.toUnhook.push(this.editor.onDidChangeCursorSelection((e) => this.resetHandler())); // https://github.com/Microsoft/vscode/issues/7827 + this.toUnhook.push(this.editor.onDidChangeCursorSelection((e) => this.onDidChangeCursorSelection(e))); this.toUnhook.push(this.editor.onDidChangeModel((e) => this.resetHandler())); this.toUnhook.push(this.editor.onDidChangeModelContent(() => this.resetHandler())); this.toUnhook.push(this.editor.onDidScrollChange((e) => { @@ -246,6 +246,12 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC })); } + private onDidChangeCursorSelection(e: editorCommon.ICursorSelectionChangedEvent): void { + if (e.selection && e.selection.startColumn !== e.selection.endColumn) { + this.resetHandler(); // immediately stop this feature if the user starts to select (https://github.com/Microsoft/vscode/issues/7827) + } + } + private onEditorMouseMove(mouseEvent: IEditorMouseEvent, withKey?: IKeyboardEvent): void { this.lastMouseMoveEvent = mouseEvent;