Match inside/around closest surrounding pair sometimes fails #10638
Replies: 4 comments
-
After a little investigation I came to the conclusion this is caused by |
Beta Was this translation helpful? Give feedback.
-
I've found that |
Beta Was this translation helpful? Give feedback.
-
@Ktoks the end/start thing is precisely this issue, the current algorithm to figure out the closest pair only looks for a mismatched closing pair, and it starts from the cursor — so with your cursor on an opening brace it will never find the correct closing brace. furthermore, if there's any mismatched closing brace (including <s) within the braces you're trying to select, it will fail to match as well. About backticks, however, they aren't a matching surround pair, so the current algorithm doesn't even consider them when looking. But for good news I think I thought of something that'll fix both of those issues in one — using the tree-sitter to find the closest pair, and only falling back to a general algorithm if no tree-sitter is active. I'll definitely experiment with this more later today |
Beta Was this translation helpful? Give feedback.
-
That's great news for those who can get treesitter working! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As a noob to Rust, I’ve started reading the rust book. The finished code block for Chapter 2 looks like this:
When I position my cursor into any part of the curly brace enclosed blocks (except for the lines with only right curly brackets) and issue the
mim
ormam
command, no selection is made.mm
goes to the enclosing braces just fine, andmi{
/mi}
works as expected and selects within the enclosing brackets.Beta Was this translation helpful? Give feedback.
All reactions