Commit 5f2587a3 authored by yann300's avatar yann300 Committed by Liana Husikyan

remove highlights if content changes

parent a16d7919
......@@ -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', [])
})
})
......
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