diff options
author | Nate Sesti <33237525+sestinj@users.noreply.github.com> | 2023-06-12 21:36:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 21:36:11 -0700 |
commit | 297511b5e3ba67e3c37e5cb4c038186093da6a95 (patch) | |
tree | c850a433c3a7d594fdeabf11cabd505bb5388d40 /extension/src/decorations.ts | |
parent | 52ffaa321ee24d2a930ac4e6ff083aaa37be79e8 (diff) | |
parent | 01cfbc179a33c99d55acdc989dbafd554db16a92 (diff) | |
download | sncontinue-297511b5e3ba67e3c37e5cb4c038186093da6a95.tar.gz sncontinue-297511b5e3ba67e3c37e5cb4c038186093da6a95.tar.bz2 sncontinue-297511b5e3ba67e3c37e5cb4c038186093da6a95.zip |
Merge pull request #76 from continuedev/superset-of-chat
Superset of chat
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) { |