Skip to content

Commit

Permalink
git-commit: highlight statuses according to length
Browse files Browse the repository at this point in the history
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
  • Loading branch information
the-mikedavis committed Jun 29, 2022
1 parent 3c86d1a commit e2b8506
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion runtime/queries/git-commit/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
(subject) @markup.heading
((subject) @markup.heading
(#match? @markup.heading "^.{1,50}$"))
((subject) @warning
(#match? @warning "^.{51,72}$"))
(subject) @error

(path) @string.special.path
(branch) @string.special.symbol
(commit) @constant
Expand Down

0 comments on commit e2b8506

Please sign in to comment.