-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mdm
not working on rightmost pair element
#11813
Comments
It is not just rust files, it can be any file |
yeah that is what I experience as well, glad I'm not the only one. I swear this used to work properly |
Trying to look into this more, and found that when there is no sort, the behavior of the inner pair is reversed, where the opening pair main selection is what deletes the outer pair. helix/helix-term/src/commands.rs Lines 5691 to 5717 in 57ec3b7
The error is coming from this function: helix/helix-core/src/surround.rs Lines 92 to 155 in 57ec3b7
|
I actually started debugging it myself and it looks like the plaintext implementation works, just not the treesitter one. And the find_matching_bracket_fuzzy call in particular is where it returns from the function due to the ? operator. That's where I left off |
Interesting, I added this: pub fn find_nth_closest_pairs_pos(
syntax: Option<&Syntax>,
text: RopeSlice,
range: Range,
skip: usize,
) -> Result<(usize, usize)> {
match syntax {
Some(syntax) => find_nth_closest_pairs_ts(syntax, text, range, skip).map_err(|err| {
log::error!("Error with `find_nth_closest_pairs_ts`");
err
}),
None => find_nth_closest_pairs_plain(text, range, skip).map_err(|err| {
log::error!("Error with `find_nth_closest_pairs_plain`");
err
}),
}
} Which when replicating the behavior led to:
|
Can you try #10611 ? |
I'm still seeing the same behavior as mentioned in this issue. As mentioned above, I seem to be triggering the error at the bottom of |
Summary
I have a rust import statement, use foo::{bar, baz};
If I place the cursor on the rightmost }, and try to do mdm it doesn't work (error says "Surround pair not found around all cursors")
But if I do mmmdm it works (delete the pair with the cursor on the leftmost {
Reproduction Steps
No response
Helix log
No response
Platform
Linux
Terminal Emulator
wezterm 20240203-110809-5046fc22
Installation Method
Nix Flake
Helix Version
helix 24.7, 748a9cf
The text was updated successfully, but these errors were encountered: