remove highlights if content changes

runInTestsCompilation
yann300 4 years ago committed by Liana Husikyan
parent a16d791988
commit 5f2587a3d4
  1. 6
      apps/remix-ide/src/app/editor/SourceHighlighters.js
  2. 1
      apps/remix-ide/src/app/editor/editor.js

@ -50,6 +50,12 @@ class SourceHighlighters {
this.highlighters[from] = []
}
discardAllHighlights () {
for (const from in this.highlighters) {
this.discardHighlight(from)
}
}
hideHighlightsExcept (toStay) {
for (const highlighter in this.highlighters) {
for (const index in this.highlighters[highlighter]) {

@ -191,6 +191,7 @@ class Editor extends Plugin {
this.event.trigger('sessionSwitched', [])
this.editor.getSession().on('change', () => {
this._onChange()
this.sourceHighlighters.discardAllHighlights()
this.event.trigger('contentChanged', [])
})
})

Loading…
Cancel
Save