summaryrefslogtreecommitdiff
path: root/extension
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-06-13 21:35:38 -0700
committerNate Sesti <sestinj@gmail.com>2023-06-13 21:35:38 -0700
commitcc3cee3184a64bba19c4b05c53c035eaedcb665c (patch)
tree8edf73f12a29bf818de53c4bc1fa274be66d74bf /extension
parent7da5ab61f70044d39a3a2d93176e6d57ab3e5524 (diff)
downloadsncontinue-cc3cee3184a64bba19c4b05c53c035eaedcb665c.tar.gz
sncontinue-cc3cee3184a64bba19c4b05c53c035eaedcb665c.tar.bz2
sncontinue-cc3cee3184a64bba19c4b05c53c035eaedcb665c.zip
fixed diff application and highlighting
Diffstat (limited to 'extension')
-rw-r--r--extension/src/continueIdeClient.ts22
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) => {