diff options
Diffstat (limited to 'extension/src/continueIdeClient.ts')
-rw-r--r-- | extension/src/continueIdeClient.ts | 18 |
1 files changed, 10 insertions, 8 deletions
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); } } |