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

add tree-sitter-git-rebase #1402

Merged
merged 11 commits into from
Dec 30, 2021

Conversation

the-mikedavis
Copy link
Member

@the-mikedavis the-mikedavis commented Dec 29, 2021

Adds syntax highlighting for the interactive rebase TODO file:

with highlighting appropriate for the long and short versions of commands (e.g. "fixup" and "f"), and injections for shell with the exec command.

And the cherry on top: injections for commit message highlighting when you're editing commit messages in a rebase:

rebase-injection

I was interested in including this on #1338, but I couldn't get the injections to work. It turns out injections seem to not work when the node being injected has an underscore in its name (e.g. rebase_command instead of rebasecommand). I suspect that there's a rogue regex in the tree-sitter code that tries to ignore injections on unnamed nodes (start with an underscore) that's mistakenly checking for any underscore at all. (edit: meant to say that I think this is a bug upstream in tree-sitter, I'll investigate 🕵️) (edit: now I can't reproduce that behavior and it works even with the underscore 🤔)

These captures are a little arbitrary, I'm open to suggestions on all of them.

Copy link
Contributor

@pickfire pickfire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you. \o/

@pickfire pickfire merged commit 8fda87a into helix-editor:master Dec 30, 2021
@the-mikedavis the-mikedavis deleted the md-tree-sitter-rebase branch December 31, 2021 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants