mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-24 06:13:31 +00:00
Fix bracket matching getting stuck when leaving the brackets
Bug: T278840 Bug: T280978 Change-Id: Ia552fcd829ce38cbb7ac7fd7ebecad971a83e4c3
This commit is contained in:
parent
6e6356ccc0
commit
5186c6f3a2
|
@ -159,6 +159,9 @@
|
||||||
} ) &&
|
} ) &&
|
||||||
// Must be empty at the end, i.e. all elements must have been found and removed
|
// Must be empty at the end, i.e. all elements must have been found and removed
|
||||||
!config.currentMarks.length;
|
!config.currentMarks.length;
|
||||||
|
|
||||||
|
// Restore config.currentMarks after the loop above destroyed the original. This is done for
|
||||||
|
// performance reasons to avoid the need for an (expensive) copy.
|
||||||
config.currentMarks = marks;
|
config.currentMarks = marks;
|
||||||
return same;
|
return same;
|
||||||
}
|
}
|
||||||
|
@ -247,7 +250,10 @@
|
||||||
if (!autoclear && config.currentlyHighlighted) {
|
if (!autoclear && config.currentlyHighlighted) {
|
||||||
config.currentlyHighlighted();
|
config.currentlyHighlighted();
|
||||||
config.currentlyHighlighted = null;
|
config.currentlyHighlighted = null;
|
||||||
|
// Backup of the new mark positions must be done after the clear above
|
||||||
|
config.currentMarks = markPositions;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < markPositions.length; i++) {
|
for (i = 0; i < markPositions.length; i++) {
|
||||||
marks.push(cm.markText(
|
marks.push(cm.markText(
|
||||||
markPositions[i].from,
|
markPositions[i].from,
|
||||||
|
|
Loading…
Reference in a new issue