diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-13 21:35:38 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-13 21:35:38 -0700 |
commit | 1e3acec89e9d91758a719b5540b0e11d811e725d (patch) | |
tree | 3f1081e4d4353170b2d76c0184326faccaa55d89 /extension | |
parent | 3ef953bcb546d776b1b589b795cb3dcdb9c0da5d (diff) | |
download | sncontinue-1e3acec89e9d91758a719b5540b0e11d811e725d.tar.gz sncontinue-1e3acec89e9d91758a719b5540b0e11d811e725d.tar.bz2 sncontinue-1e3acec89e9d91758a719b5540b0e11d811e725d.zip |
fixed diff application and highlighting
Diffstat (limited to 'extension')
-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) => { |