0f01568dd8b7a304a7a2ed2d576b100e2d3610cf
`find_pair` looked up the node under the cursor with an empty byte range. When a zero-width node starts at that position, tree-sitter returns it, and since it is hidden the lookup resolves to its visible parent instead. Typst emits such a token right before the `(` or `[` of a call, so on those brackets `mm` either did nothing or jumped to the closing bracket of an outer pair. `find_matching_bracket` had the same problem. Look up the byte under the cursor instead, like the plaintext fallback at the end of `find_pair` already does.
Languages
Rust
100%