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 | 40ba9eaf82a1386ccacf5046c072df3d131d5284 (patch) | |
tree | bf2267e7d1abd34b408265bec8c8c189366bec32 /extension/src/decorations.ts | |
parent | af34f8eae701a875a2a85fca29ffc0d88deb1400 (diff) | |
download | sncontinue-40ba9eaf82a1386ccacf5046c072df3d131d5284.tar.gz sncontinue-40ba9eaf82a1386ccacf5046c072df3d131d5284.tar.bz2 sncontinue-40ba9eaf82a1386ccacf5046c072df3d131d5284.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) { |