Commit d7204faf authored by LianaHus's avatar LianaHus

force discard all highlights when plugin is deactivated

parent 95c48637
......@@ -97,6 +97,7 @@ export class SidePanel extends AbstractPanel {
removeView (profile) {
super.removeView(profile)
this.emit('pluginDisabled', profile.name)
this.verticalIcons.unlinkContent(profile)
}
......
......@@ -42,7 +42,6 @@ class SourceHighlighters {
}
}
discardHighlight (from) {
if (this.highlighters[from]) {
for (const index in this.highlighters[from]) this.highlighters[from][index].currentSourceLocation(null)
......
......@@ -198,10 +198,12 @@ class Editor extends Plugin {
onActivation () {
this.on('sidePanel', 'focusChanged', (name) => this.sourceHighlighters.hideHighlightsExcept(name))
this.on('sidePanel', 'pluginDisabled', (name) => this.sourceHighlighters.discardHighlight(name))
}
onDeactivation () {
this.off('sidePanel', 'focusChanged')
this.off('sidePanel', 'pluginDisabled')
}
highlight (position, filePath, hexColor) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment