summaryrefslogtreecommitdiffstats
path: root/runtime/syntax
diff options
context:
space:
mode:
authorTim Pope <code@tpope.net>2023-12-28 12:48:27 -0500
committerChristian Brabandt <cb@256bit.org>2023-12-28 23:17:54 +0100
commitfda02d03c0cfe017e465c58b3baf8b3106287578 (patch)
tree012ecdf8dfe4e53aab0a5244dfead74d320f21cc /runtime/syntax
parent757714c0cba7772b987b2513559bcb74ce53ce3f (diff)
runtime(gitcommit): Updates to ftplugin and syntax
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/gitcommit.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/syntax/gitcommit.vim b/runtime/syntax/gitcommit.vim
index 42c8d4414f..bce6772762 100644
--- a/runtime/syntax/gitcommit.vim
+++ b/runtime/syntax/gitcommit.vim
@@ -2,7 +2,7 @@
" Language: git commit file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Filenames: *.git/COMMIT_EDITMSG
-" Last Change: 2022 Jan 05
+" Last Change: 2023 Dec 28
if exists("b:current_syntax")
finish
@@ -21,7 +21,11 @@ endif
syn include @gitcommitDiff syntax/diff.vim
syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|@@\@!\|[^[:alnum:]\ +-]\S\@!\)\@=/ fold contains=@gitcommitDiff
-syn match gitcommitSummary "^.*\%<51v." contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell
+if get(g:, 'gitcommit_summary_length') < 0
+ syn match gitcommitSummary "^.*$" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell
+elseif get(g:, 'gitcommit_summary_length', 1) > 0
+ exe 'syn match gitcommitSummary "^.*\%<' . (get(g:, 'gitcommit_summary_length', 50) + 1) . 'v." contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell'
+endif
syn match gitcommitOverflow ".*" contained contains=@Spell
syn match gitcommitBlank "^.\+" contained contains=@Spell
syn match gitcommitFirstLine "\%^.*" nextgroup=gitcommitBlank,gitcommitComment skipnl