diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-12 10:50:33 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-12 10:50:33 -0700 |
commit | 792b65745b89bb59802294357378113493d25b63 (patch) | |
tree | 1d038ca5e1ac837fa704b454136f597bdd02797d /extension/src/decorations.ts | |
parent | c66f39173bec7e45955dc8b96ae6c44ed5bdc162 (diff) | |
download | sncontinue-792b65745b89bb59802294357378113493d25b63.tar.gz sncontinue-792b65745b89bb59802294357378113493d25b63.tar.bz2 sncontinue-792b65745b89bb59802294357378113493d25b63.zip |
calculate diff and highlight changes
Diffstat (limited to 'extension/src/decorations.ts')
-rw-r--r-- | extension/src/decorations.ts | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/extension/src/decorations.ts b/extension/src/decorations.ts index 456f0c10..d2c94135 100644 --- a/extension/src/decorations.ts +++ b/extension/src/decorations.ts @@ -94,15 +94,22 @@ class DecorationManager { decorationTypes = new Map(); decorationTypes.set(key.decorationType, [key.options]); this.editorToDecorations.set(key.editorUri, decorationTypes); - } - - const decorations = decorationTypes.get(key.decorationType); - if (!decorations) { - decorationTypes.set(key.decorationType, [key.options]); } else { - decorations.push(key.options); + const decorations = decorationTypes.get(key.decorationType); + if (!decorations) { + decorationTypes.set(key.decorationType, [key.options]); + } else { + decorations.push(key.options); + } } + this.rerenderDecorations(key.editorUri, key.decorationType); + + vscode.window.onDidChangeTextEditorSelection((event) => { + if (event.textEditor.document.fileName === key.editorUri) { + this.deleteAllDecorations(key.editorUri); + } + }); } deleteDecoration(key: DecorationKey) { |