-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Git commit message length based highlighting #2882
Comments
It's not the same but you could use the ruler feature to indicate a max line length |
I tried this out initially in tree-sitter-git-commit but I found that tree-sitter's compilation time for the grammar shot way up when using regular expressions with count quantifiers like choice(alias(/.{1,50}/, $.short_message), alias(/.{51,}/, $.long_message)) I do want this kind of highlight though. I'll take a look at how bad that performance really gets and if it affects runtime performance or just compile-time. We can also try doing this by changing the queries instead of the grammar. |
This is simpler than the neovim counterpart, we simply switch scope based on length: * 1-50: `markup.heading` * 51-72: `warning` * 73+: `error` closes helix-editor#2882
It's possible to do this if you'd like to override your In order for this to be a good core feature we'd like to have it be configurable:
even if it's enabled by default (which is not a given). Once we change configuration languages from TOML to something more general purpose it should be easier to support this1. In the meantime, the rulers feature is a reasonable way to guide commit message lengths (though not perfect because of the different good-practice lengths of messages and bodies). Footnotes
|
Describe your feature request
When using helix as the editor for git I want the commit message to have highlighting which indicates whether it is too long (over 50 characters).
This is available in Neovim like this:
I think this is a useful feature for making sure your messages are not too long.
The text was updated successfully, but these errors were encountered: