-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Bracket goto skipping function
struct
enum
union
trait
impl
items and wrongly selecting comments in Rust
#3589
Comments
I'm not sure why comments are being matched on in the function textobject for rust: helix/runtime/queries/rust/textobjects.scm Lines 2 to 6 in e066782
I think it should fix it to just have the textobject be (function_item
body: (_) @function.inside) @function.around Would you like to make a PR? |
I tried changing:
to
as you suggested, but it doesn't work. Is this what you meant? Sorry, this is the first time I have looked at a text object file. |
I mean that we can remove the whole outer part and only use the -(
- [
- (attribute_item)+
- (line_comment)+
- ]*
- .
- (function_item
- body: (_) @function.inside)) @function.around
+(function_item
+ body: (_) @function.inside) @function.around I think we should be able to do that for all of those patterns that start with |
function
struct
enum
union
trait
impl
items and wrongly selecting comments in Rust
@the-mikedavis I have made a PR #3590. Please could you have a look? Thanks. |
Summary
gg]f
takes you to the second function, it should bemain
, the next one downge[f
3 times results in the first function AND the comments being selected (as shown below):The exact same thing happens for
struct
enum
union
trait
andimpl
items as well.Reproduction Steps
In summary above
Helix log
n/a
Platform
Linux
Terminal Emulator
Kitty
Helix Version
helix 22.05 (e066782)
The text was updated successfully, but these errors were encountered: