From 635fc705f966c25f464400adb02e98cc0fc0ba4d Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 4 Nov 2020 17:41:11 +0300 Subject: [PATCH] correctly clear gutter marks for sublime bookmarks --- edit/codemirror-default.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/edit/codemirror-default.js b/edit/codemirror-default.js index 72dace8b..dc987a6a 100644 --- a/edit/codemirror-default.js +++ b/edit/codemirror-default.js @@ -172,8 +172,9 @@ elBookmark.textContent = '\u00A0'; const clearMarker = function () { const line = this.lines[0]; - CodeMirror.TextMarker.prototype.clear.apply(this); - if (!line.markedSpans.some(span => span.marker.sublimeBookmark)) { + delete this.clear; // removing our patch from the instance... + this.clear(); // ...and using the original prototype + if (!(line.markedSpans || []).some(span => span.marker.sublimeBookmark)) { this.doc.setGutterMarker(line, CM_BOOKMARK_GUTTER, null); } };