Skip to content
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

"Closest surrounding pair (tree-sitter)" not working anymore in git context #10651

Open
karthago1 opened this issue May 1, 2024 · 3 comments
Labels
C-bug Category: This is a bug

Comments

@karthago1
Copy link
Contributor

Summary

Since we have git highlighting, I think this bug is introduced

Just create a file named "COMMIT_EDITMSG" and paste the following text

changelog:
383aa7b (HEAD -> hich/ethernet) commit 1
e10a36a commit 2

go inside the parentheses and press "mam" in normal mode. result: No thing is selected.

Repeat the same steps in a new buffer and the selection will be successful

here is a video
https://asciinema.org/a/PpvQrhXxDVg7EihKWGZAfqRla

Reproduction Steps

No response

Helix log

No response

Platform

Linux

Terminal Emulator

kitty

Installation Method

source

Helix Version

24.03-147-g752ed8eb

@karthago1 karthago1 added the C-bug Category: This is a bug label May 1, 2024
@woojiq
Copy link
Contributor

woojiq commented May 1, 2024

I'm not sure if this is a bug. tree-sitter for git does not define a node for pairs (like markdown tree-sitter). Type :tree-sitter-subtree. All tree-sitter motions don't work for pairs either (I mean mm, A-o, etc). Use ma(.

@pascalkuthe
Copy link
Member

Yeah this behaves as expected. Altough for some TS grammars (basically anything that is not a proper language) we may want to switch back to plaintext (maybe with a per language setting) but it could also just be fine to require the use of the more explicit plaintext bindings (mi()

@karthago1
Copy link
Contributor Author

karthago1 commented May 1, 2024

the result of :tree-sitter-subtree is

(message
     (commit))

mi( and ma( work fine.

we may want to switch back to plaintext (maybe with a per language setting)

thank you for the tip. I just disabled the the highlighting by editing languages.toml

[[language]]
name = "git-commit"
file-types = []

now I have the same behavior as the released version. (it looks not as nice as the highlighted version, but more functional)

should I close this issue. since it is not a bug in helix itself, but in the tree sitter definition of git?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants