Skip to content

Commit b10bb86

Browse files
committed
[matchbrackets] Re-introduce maxHighlightLineLength
This reverts commit df85b9c.
1 parent 58d7c16 commit b10bb86

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

addon/edit/matchbrackets.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@
7575

7676
function matchBrackets(cm, autoclear, config) {
7777
// Disable brace matching in long lines, since it'll cause hugely slow updates
78-
var maxScanLen = cm.state.matchBrackets.maxScanLineLength || 1000;
78+
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
7979
var marks = [], ranges = cm.listSelections();
8080
for (var i = 0; i < ranges.length; i++) {
8181
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
82-
if (match && cm.getLine(match.from.line).length <= maxScanLen) {
82+
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
8383
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
8484
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
85-
if (match.to && cm.getLine(match.to.line).length <= maxScanLen)
85+
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
8686
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
8787
}
8888
}

doc/manual.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,6 +2402,8 @@ <h2 id="addons">Addons</h2>
24022402
<dd>Stop after scanning this amount of lines without a successful match. Defaults to 1000.</dd>
24032403
<dt><strong><code>maxScanLineLength</code></strong></dt>
24042404
<dd>Ignore lines longer than this. Defaults to 10000.</dd>
2405+
<dt><strong><code>maxHighlightLineLength</code></strong></dt>
2406+
<dd>Don't highlight a bracket in a line longer than this. Defaults to 1000.</dd>
24052407
</dl></dd>
24062408

24072409
<dt id="addon_closebrackets"><a href="../addon/edit/closebrackets.js"><code>edit/closebrackets.js</code></a></dt>

0 commit comments

Comments
 (0)