force discard all highlights when plugin is deactivated

highlightsCleaner
LianaHus 4 years ago
parent 95c48637b1
commit d7204fafd0
  1. 1
      apps/remix-ide/src/app/components/side-panel.js
  2. 1
      apps/remix-ide/src/app/editor/SourceHighlighters.js
  3. 2
      apps/remix-ide/src/app/editor/editor.js

@ -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) {

Loading…
Cancel
Save