From e2b8506cca5cf6957cfa24b5179a070ee19ae37d Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 28 Jun 2022 21:01:31 -0500 Subject: [PATCH] git-commit: highlight statuses according to length 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/helix#2882 --- runtime/queries/git-commit/highlights.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/queries/git-commit/highlights.scm b/runtime/queries/git-commit/highlights.scm index bdb776d6dd6ab..f5f1eae6cf16a 100644 --- a/runtime/queries/git-commit/highlights.scm +++ b/runtime/queries/git-commit/highlights.scm @@ -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