mediawiki-extensions-CodeMi.../resources/modules/ve-cm
Thiemo Kreuz a43acbeb6b Activate bracket matching for longer lines
The addon does have 3 settings:
- maxHighlightLineLength is for the current line where the
  cursor is. Bracket matching is simply not done when the
  current line is longer. The default is 1000, which is rather
  low.
- maxScanLineLength is for every other line that is scanned in
  the process. I don't understand why, but this limit is 10x
  higher.
- maxScanLines is the number of lines that can be scanned.

Simply raising the first to be 10000 as well fixes our issue.

Note that CodeMirror does have a limit of 10000 anyway. It's
called maxHighlightLength there. Lines that are longer get
syntax highlighting only for the first 10000 characters. The
rest of the line is black. Using the same limit in the addon
makes it's behavior consistent. Means: The user can see when
the syntax highlighting stops, and bracket matching stops
working the same time.

I benchmarked with both settings. It doesn't have a measurable
effect. Bracket matching is done in <1ms in both cases.

Bug: T270237
Change-Id: Ia56bf4c2fb023c9f117376242221d39f51196173
2021-01-14 11:28:02 +00:00
..
.eslintrc.json Remove obsolete aliases from closures 2018-11-12 13:19:41 +00:00
ve.ui.CodeMirror.init.js VE: Add explicit dependency on targetLoader 2020-06-30 22:47:41 +01:00
ve.ui.CodeMirror.init.less Merge "Integrated bracket matching for CodeMirror with VisualEditor" 2021-01-05 11:37:57 +00:00
ve.ui.CodeMirrorAction.js Activate bracket matching for longer lines 2021-01-14 11:28:02 +00:00
ve.ui.CodeMirrorTool.js Record usage statistics for syntax highlighting 2020-11-25 15:18:01 +01:00