From 5a76c5692b39e8d4e6d2cbc4c80be4263277a20b Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sun, 18 Jun 2023 15:41:09 -0700 Subject: a number of things --- extension/src/continueIdeClient.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'extension/src/continueIdeClient.ts') diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index b4937ac4..3b5de93f 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -158,15 +158,17 @@ class IdeProtocolClient { }); editor.setDecorations(decorationType, [range]); - // Listen for changes to cursor position - const cursorDisposable = vscode.window.onDidChangeTextEditorSelection( - (event) => { - if (event.textEditor.document.uri.fsPath === rangeInFile.filepath) { - cursorDisposable.dispose(); - editor.setDecorations(decorationType, []); + // Listen for changes to cursor position and then remove the decoration (but keep for at least 2 seconds) + setTimeout(() => { + const cursorDisposable = vscode.window.onDidChangeTextEditorSelection( + (event) => { + if (event.textEditor.document.uri.fsPath === rangeInFile.filepath) { + cursorDisposable.dispose(); + editor.setDecorations(decorationType, []); + } } - } - ); + ); + }, 2000); } } -- cgit v1.2.3-70-g09d2