helix icon indicating copy to clipboard operation
helix copied to clipboard

tree-sitter independent bracket matching

Open sohnryang opened this issue 2 years ago • 2 comments

Describe your feature request

Currently helix editor depends heavily on tree-sitter to provide bracket matching. However, this makes the editor is unable to give correct results when tree-sitter does not have relevant information regarding brackets' placements. (examples are #1108, #2110, #3357 and #3487) Therefore, bracket matching which works regardless of tree-sitter availability is needed.

sohnryang avatar Aug 28 '22 00:08 sohnryang

We need a combination of both: using tree-sitter means that unmatched brackets in comments or strings don't break bracket matching in the whole file, and tree-sitter independent matching is needed for plain text files and comments.

Ordoviz avatar Aug 28 '22 06:08 Ordoviz

Also, if nothing was matched via tree sitter matching, we could fallback to the tree-sitter independent matching to increase chances of doing what the user expects. ( that could be helpful in cases like people editing YAML, for which there is a tree-sitter grammar, but you may still expect some plain text matching to work )

alevinval avatar Oct 14 '22 17:10 alevinval

This issue can now be closed after #4288 was merged

alevinval avatar Jun 05 '23 14:06 alevinval