diff options
author | Ty Dunn <ty@tydunn.com> | 2023-06-13 21:37:17 -0700 |
---|---|---|
committer | Ty Dunn <ty@tydunn.com> | 2023-06-13 21:37:17 -0700 |
commit | f3e8d6bfc2b6a79f155288372aabbee9632c0c0c (patch) | |
tree | 97034f7c7089a75e032ebcf7685cdd28cd029a73 /extension/src | |
parent | 9acb201a6f55ab527f86997329c8e127fdde1cc7 (diff) | |
parent | d058ca3c36209831c488d5986d9dd1194dacb5f0 (diff) | |
download | sncontinue-f3e8d6bfc2b6a79f155288372aabbee9632c0c0c.tar.gz sncontinue-f3e8d6bfc2b6a79f155288372aabbee9632c0c0c.tar.bz2 sncontinue-f3e8d6bfc2b6a79f155288372aabbee9632c0c0c.zip |
Merge branch 'main' of github.com:continuedev/continue
Diffstat (limited to 'extension/src')
-rw-r--r-- | extension/src/continueIdeClient.ts | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index 92af6b10..782219dc 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -140,12 +140,20 @@ class IdeProtocolClient { vscode.ViewColumn.One ); if (editor) { - editor.setDecorations( - vscode.window.createTextEditorDecorationType({ - backgroundColor: color, - isWholeLine: true, - }), - [range] + const decorationType = vscode.window.createTextEditorDecorationType({ + backgroundColor: color, + isWholeLine: true, + }); + 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, []); + } + } ); } } @@ -282,7 +290,7 @@ class IdeProtocolClient { edit.range.start.line, edit.range.start.character, edit.range.end.line, - edit.range.end.character + edit.range.end.character + 1 ); editor.edit((editBuilder) => { |