Page MenuHomePhabricator

Matching brackets not highlighted unless cursor positioned beside them in CM6
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Activate Improved Syntax Highlighting in Beta Features
  • Edit a template
  • Put cursor into text bounded by opening and closing brackets but not right next to them

(e.g. {{ template text (CURSOR HERE) template text }} )

What happens?:

  • Innermost brackets not highlighted

What should have happened instead?:

  • Innermost pair of brackets should be highlighted, as they are if the beta feature is disabled

Behavior is extra noticeable with the following CSS applied (no effect if beta feature is on, has effect if disabled):

.cm-mw-matchingbracket {
	background-color: yellow;
	box-shadow: none;
}

.cm-mw-matchingbracket ~ .cm-mw-parserfunction-delimiter {
	background-color: yellow;
}

Other information (browser name/version, screenshots, etc.): Firefox 133.0 64-bit on Windows 11
Screenshot comparison: https://i.imgur.com/QXjA5tr.png (notice yellow brackets in lines 4 and 10)

Event Timeline

Change #1163300 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] CodeMirrorBracketMatching: surrounding brackets

https://gerrit.wikimedia.org/r/1163300

Change #1163300 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CodeMirrorBracketMatching: surrounding brackets

https://gerrit.wikimedia.org/r/1163300

Bhsd moved this task from Improvement to Done on the MediaWiki-extensions-CodeMirror board.