Bug: Matching brackets not working in plain text.
Reproduction steps
Expected: Using mm on an eligible character will go to the matching character in the pair.
Actual: This only seems to work in files with a language server?
https://user-images.githubusercontent.com/70898/141857740-3cfd7da9-3e57-414c-b6dc-8fae4d277c08.mp4
Environment
- Platform: macOS
- Helix version: v0.5.0-114-g225e790
Parsing of matching brackets is done by Tree Sitter, so mm only works on files with a Tree Sitter grammar (not language server).
Right, I meant tree sitter, good correction. But I wasn't clear if @archseer was saying it should also work on raw text as well:

Yeah so mm specifically requires tree-sitter: https://docs.helix-editor.com/keymap.html#match-mode
@sudormrfbin recently labeled all the keybindings that require a LSP or a tree-sitter grammar
Interesting, thanks!
Also wondering about why some brackets match in tree-sitter supported files and others don't:
https://user-images.githubusercontent.com/70898/142031507-84b35f13-8a2b-4eaa-855f-315b820112e9.mp4
I think that's because it's not the first and last item in a named node.
https://github.com/ikatyang/tree-sitter-toml/blob/7cff70bbcbbc62001b465603ca1ea88edd668704/grammar.js#L48-L55
table: $ =>
seq(
"[",
choice($.dotted_key, $._key),
"]",
$._line_ending_or_eof,
repeat(choice($.pair, newline)),
),
Our implementation.
https://github.com/helix-editor/helix/blob/ed76cdf238b93846fa4edd8f926f6c05fc26b9fd/helix-core/src/match_brackets.rs#L22-L28
Notice the you showed that worked because it's the first and last item.
https://github.com/ikatyang/tree-sitter-toml/blob/7cff70bbcbbc62001b465603ca1ea88edd668704/grammar.js#L187-L200
array: $ =>
seq(
"[",
repeat(newline),
optional(
seq(
$._inline_value,
repeat(newline),
repeat(seq(",", repeat(newline), $._inline_value, repeat(newline))),
optional(seq(",", repeat(newline))),
),
),
"]",
),
Not very familiar with this, not sure how to solve.
We need an implementation sans tree-sitter anyway for working with plaintext files or files without a grammar, so we could fall back to that if tree-sitter based matching returns no results.
I too have noticed that mm doesn't work in many places.
This was adrwssed by #4288 and shortcoming in bracket matching when TS is available discussed in the comments were addressed I'm a seperate PR