remove highlights if content changes

removeHighlights
yann300 4 years ago committed by LianaHus
parent ac3c22c8f3
commit 939fa3ea2a
  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