Skip to content

Commit f8b765b

Browse files
committed
[matchbrackets addon] Clear matched brackets when the addon is turned off
Closes codemirror#4128
1 parent 23172fd commit f8b765b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

addon/edit/matchbrackets.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@
102102
}
103103

104104
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
105-
if (old && old != CodeMirror.Init)
105+
if (old && old != CodeMirror.Init) {
106106
cm.off("cursorActivity", doMatchBrackets);
107+
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
108+
}
107109
if (val) {
108110
cm.state.matchBrackets = typeof val == "object" ? val : {};
109111
cm.on("cursorActivity", doMatchBrackets);

0 commit comments

Comments
 (0)