correctly clear gutter marks for sublime bookmarks

This commit is contained in:
tophf 2020-11-04 17:41:11 +03:00
parent 31558d5071
commit 635fc705f9

View File

@ -172,8 +172,9 @@
elBookmark.textContent = '\u00A0'; elBookmark.textContent = '\u00A0';
const clearMarker = function () { const clearMarker = function () {
const line = this.lines[0]; const line = this.lines[0];
CodeMirror.TextMarker.prototype.clear.apply(this); delete this.clear; // removing our patch from the instance...
if (!line.markedSpans.some(span => span.marker.sublimeBookmark)) { this.clear(); // ...and using the original prototype
if (!(line.markedSpans || []).some(span => span.marker.sublimeBookmark)) {
this.doc.setGutterMarker(line, CM_BOOKMARK_GUTTER, null); this.doc.setGutterMarker(line, CM_BOOKMARK_GUTTER, null);
} }
}; };