Mercurial > vim
annotate runtime/syntax/gitcommit.vim @ 34662:81e6583c8b73 v9.1.0214
patch 9.1.0214: Duplicate condition in win_lbr_chartabsize()
Commit: https://github.com/vim/vim/commit/5532d3b3f0c73d4e0fa07122ebbed3bf201870f9
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu Mar 28 10:04:25 2024 +0100
patch 9.1.0214: Duplicate condition in win_lbr_chartabsize()
Problem: Duplicate condition in win_lbr_chartabsize().
Solution: Remove the duplicate condition, as it's already checked above.
(zeertzjq)
closes: #14320
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 28 Mar 2024 10:15:06 +0100 |
parents | 9828ad8d79bd |
children |
rev | line source |
---|---|
1624 | 1 " Vim syntax file |
2 " Language: git commit file | |
2034 | 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
1624 | 4 " Filenames: *.git/COMMIT_EDITMSG |
34039
9828ad8d79bd
runtime(gitcommit): Updates to ftplugin and syntax
Christian Brabandt <cb@256bit.org>
parents:
27036
diff
changeset
|
5 " Last Change: 2023 Dec 28 |
1624 | 6 |
7 if exists("b:current_syntax") | |
2202 | 8 finish |
1624 | 9 endif |
10 | |
27036 | 11 scriptencoding utf-8 |
12 | |
1624 | 13 syn case match |
14 syn sync minlines=50 | |
27036 | 15 syn sync linebreaks=1 |
1624 | 16 |
17 if has("spell") | |
2202 | 18 syn spell toplevel |
1624 | 19 endif |
20 | |
21 syn include @gitcommitDiff syntax/diff.vim | |
27036 | 22 syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|@@\@!\|[^[:alnum:]\ +-]\S\@!\)\@=/ fold contains=@gitcommitDiff |
1624 | 23 |
34039
9828ad8d79bd
runtime(gitcommit): Updates to ftplugin and syntax
Christian Brabandt <cb@256bit.org>
parents:
27036
diff
changeset
|
24 if get(g:, 'gitcommit_summary_length') < 0 |
9828ad8d79bd
runtime(gitcommit): Updates to ftplugin and syntax
Christian Brabandt <cb@256bit.org>
parents:
27036
diff
changeset
|
25 syn match gitcommitSummary "^.*$" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell |
9828ad8d79bd
runtime(gitcommit): Updates to ftplugin and syntax
Christian Brabandt <cb@256bit.org>
parents:
27036
diff
changeset
|
26 elseif get(g:, 'gitcommit_summary_length', 1) > 0 |
9828ad8d79bd
runtime(gitcommit): Updates to ftplugin and syntax
Christian Brabandt <cb@256bit.org>
parents:
27036
diff
changeset
|
27 exe 'syn match gitcommitSummary "^.*\%<' . (get(g:, 'gitcommit_summary_length', 50) + 1) . 'v." contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell' |
9828ad8d79bd
runtime(gitcommit): Updates to ftplugin and syntax
Christian Brabandt <cb@256bit.org>
parents:
27036
diff
changeset
|
28 endif |
1624 | 29 syn match gitcommitOverflow ".*" contained contains=@Spell |
27036 | 30 syn match gitcommitBlank "^.\+" contained contains=@Spell |
31 syn match gitcommitFirstLine "\%^.*" nextgroup=gitcommitBlank,gitcommitComment skipnl | |
18818 | 32 |
27036 | 33 let s:scissors = 0 |
34 let s:l = search('^[#;@!$%^&|:] -\{24,\} >8 -\{24,\}$', 'cnW', '', 100) | |
35 if s:l == 0 | |
36 let s:l = line('$') | |
37 elseif getline(s:l)[0] !=# getline(s:l - 1)[0] | |
38 let s:scissors = 1 | |
39 endif | |
40 let s:comment = escape((matchstr(getline(s:l), '^[#;@!$%^&|:]\S\@!') . '#')[0], '^$.*[]~\"/') | |
41 | |
42 if s:scissors | |
43 let s:comment .= ' -\{24,\} >8 -\{24,\}$' | |
44 exe 'syn region gitcommitComment start="^' . s:comment . '" end="\%$" contains=gitcommitDiff' | |
18818 | 45 else |
27036 | 46 exe 'syn match gitcommitComment "^' . s:comment . '.*"' |
18818 | 47 endif |
27036 | 48 exe 'syn match gitcommitTrailers "\n\@<=\n\%([[:alnum:]-]\+\s*:.*\|(cherry picked from commit .*\)\%(\n\s.*\|\n[[:alnum:]-]\+\s*:.*\|\n(cherry picked from commit .*\)*\%(\n\n*\%(' . s:comment . '\)\|\n*\%$\)\@="' |
49 | |
50 unlet s:l s:comment s:scissors | |
18818 | 51 |
27036 | 52 syn match gitcommitTrailerToken "^[[:alnum:]-]\+\s*:" contained containedin=gitcommitTrailers |
53 | |
54 syn match gitcommitHash "\<\x\{40,}\>" contains=@NoSpell display | |
55 syn match gitcommitOnBranch "\%(^. \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite | |
56 syn match gitcommitOnBranch "\%(^. \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite | |
3465 | 57 syn match gitcommitBranch "[^ ']\+" contained |
27036 | 58 syn match gitcommitNoBranch "\%(^. \)\@<=Not currently on any branch." contained containedin=gitcommitComment |
59 syn match gitcommitHeader "\%(^. \)\@<=\S.*[::]\%(\n^$\)\@!$" contained containedin=gitcommitComment | |
60 syn region gitcommitAuthor matchgroup=gitCommitHeader start=/\%(^. \)\@<=\%(Author\|Committer\|Date\):/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent | |
61 syn match gitcommitHeader "\%(^. \)\@<=commit\%( \x\{40,\}$\)\@=" contained containedin=gitcommitComment nextgroup=gitcommitHash skipwhite | |
62 syn match gitcommitNoChanges "\%(^. \)\@<=No changes$" contained containedin=gitcommitComment | |
1624 | 63 |
27036 | 64 syn match gitcommitType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/::]*[^[:punct:][:space:]][::]\ze "he=e-1 contained containedin=gitcommitComment nextgroup=gitcommitFile skipwhite |
65 syn match gitcommitFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitArrow | |
66 syn match gitcommitArrow " -> " contained nextgroup=gitcommitFile | |
67 syn match gitcommitUntrackedFile "\%(^.\t\)\@<=[^::/]*\%(/.*\)\=$" contained containedin=gitcommitComment | |
1624 | 68 |
27036 | 69 syn region gitcommitUntracked start=/^\z(.\) Untracked files:$/ end=/^\z1\=$\|^\z1\@!/ contains=gitcommitHeader containedin=gitcommitComment containedin=gitcommitComment contained transparent fold |
70 syn region gitcommitDiscarded start=/^\z(.\) Change\%(s not staged for commit\|d but not updated\):$/ end=/^\z1\=$\|^\z1\@!/ contains=gitcommitHeader,gitcommitDiscardedType containedin=gitcommitComment containedin=gitcommitComment contained transparent fold | |
71 syn region gitcommitSelected start=/^\z(.\) Changes to be committed:$/ end=/^\z1$\|^\z1\@!/ contains=gitcommitHeader,gitcommitSelectedType containedin=gitcommitComment containedin=gitcommitComment contained transparent fold | |
72 syn region gitcommitUnmerged start=/^\z(.\) Unmerged paths:$/ end=/^\z1\=$\|^\z1\@!/ contains=gitcommitHeader,gitcommitUnmergedType containedin=gitcommitComment containedin=gitcommitComment contained transparent fold | |
1624 | 73 |
27036 | 74 syn match gitcommitUntrackedFile "\%(^.\t\)\@<=.*" contained containedin=gitcommitUntracked |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
75 |
27036 | 76 syn match gitcommitDiscardedType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/::]*[^[:punct:][:space:]][::]\ze "he=e-1 contained nextgroup=gitcommitDiscardedFile skipwhite |
77 syn match gitcommitSelectedType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/::]*[^[:punct:][:space:]][::]\ze "he=e-1 contained nextgroup=gitcommitSelectedFile skipwhite | |
78 syn match gitcommitUnmergedType "\%(^.\t\)\@<=[^[:punct:][:space:]][^/::]*[^[:punct:][:space:]][::]\ze "he=e-1 contained nextgroup=gitcommitUnmergedFile skipwhite | |
79 syn match gitcommitDiscardedFile "\S.\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow | |
80 syn match gitcommitSelectedFile "\S.\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow | |
81 syn match gitcommitUnmergedFile "\S.\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitUnmergedArrow | |
1624 | 82 syn match gitcommitDiscardedArrow " -> " contained nextgroup=gitcommitDiscardedFile |
83 syn match gitcommitSelectedArrow " -> " contained nextgroup=gitcommitSelectedFile | |
27036 | 84 syn match gitcommitUnmergedArrow " -> " contained nextgroup=gitcommitUnmergedFile |
1624 | 85 |
86 hi def link gitcommitSummary Keyword | |
27036 | 87 hi def link gitcommitTrailerToken Label |
1624 | 88 hi def link gitcommitComment Comment |
27036 | 89 hi def link gitcommitHash Identifier |
1624 | 90 hi def link gitcommitOnBranch Comment |
91 hi def link gitcommitBranch Special | |
2034 | 92 hi def link gitcommitNoBranch gitCommitBranch |
1624 | 93 hi def link gitcommitDiscardedType gitcommitType |
94 hi def link gitcommitSelectedType gitcommitType | |
2034 | 95 hi def link gitcommitUnmergedType gitcommitType |
1624 | 96 hi def link gitcommitType Type |
2034 | 97 hi def link gitcommitNoChanges gitcommitHeader |
1624 | 98 hi def link gitcommitHeader PreProc |
99 hi def link gitcommitUntrackedFile gitcommitFile | |
100 hi def link gitcommitDiscardedFile gitcommitFile | |
101 hi def link gitcommitSelectedFile gitcommitFile | |
2034 | 102 hi def link gitcommitUnmergedFile gitcommitFile |
1624 | 103 hi def link gitcommitFile Constant |
104 hi def link gitcommitDiscardedArrow gitcommitArrow | |
105 hi def link gitcommitSelectedArrow gitcommitArrow | |
2034 | 106 hi def link gitcommitUnmergedArrow gitcommitArrow |
1624 | 107 hi def link gitcommitArrow gitcommitComment |
108 "hi def link gitcommitOverflow Error | |
109 hi def link gitcommitBlank Error | |
110 | |
111 let b:current_syntax = "gitcommit" |