annotate runtime/syntax/git.vim @ 22719:8da5e18effc5 v8.2.1908

patch 8.2.1908: Lua is initialized even when not used Commit: https://github.com/vim/vim/commit/c8970b94645d0730f4a7cc42388ff32665398e8b Author: Bram Moolenaar <Bram@vim.org> Date: Mon Oct 26 20:18:08 2020 +0100 patch 8.2.1908: Lua is initialized even when not used Problem: Lua is initialized even when not used. Solution: Put lua_init() after check for "eap->skip". (Christian Brabandt, closes #7191). Avoid compiler warnings.
author Bram Moolenaar <Bram@vim.org>
date Mon, 26 Oct 2020 20:30:03 +0100
parents 5c40013d45ee
children 3e661b0cf500
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
1 " Vim syntax file
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
2 " Language: generic git output
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 2202
diff changeset
4 " Last Change: 2019 Dec 05
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
5
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
6 if exists("b:current_syntax")
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
7 finish
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
8 endif
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
9
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
10 syn case match
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
11 syn sync minlines=50
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
12
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
13 syn include @gitDiff syntax/diff.vim
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
14
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
15 syn region gitHead start=/\%^/ end=/^$/
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 2202
diff changeset
16 syn region gitHead start=/\%(^commit\%( \x\{40\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
17
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
18 " For git reflog and git show ...^{tree}, avoid sync issues
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
19 syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
20 syn match gitHead /^\x\{40\} \x\{40}\t.*/
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
21
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
22 syn region gitDiff start=/^\%(diff --git \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
23 syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) \|$\)\@=/ contains=@gitDiff
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
24
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
25 syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
26 syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
27 syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 2202
diff changeset
28 syn match gitDiffAdded "{+.*+}" contained containedin=gitDiff
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
29 syn match gitDiffRemoved "^ \+-.*" contained containedin=gitDiffMerge
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 2202
diff changeset
30 syn match gitDiffRemoved "\[-.*-\]" contained containedin=gitDiff
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
31
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
32 syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
33 syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
34 syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 2202
diff changeset
35 syn match gitMode /^\d\{6\}\>/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
36 syn match gitIdentityKeyword /^\%(author\|committer\|tagger\)\>/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
37 syn match gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
38 syn match gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
39
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
40 syn match gitReflogHeader /^Reflog:/ contained containedin=gitHead nextgroup=gitReflogMiddle skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
41 syn match gitReflogHeader /^Reflog message:/ contained containedin=gitHead skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
42 syn match gitReflogMiddle /\S\+@{\d\+} (/he=e-2 nextgroup=gitIdentity
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
43
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
44 syn match gitDate /\<\u\l\l \u\l\l \d\=\d \d\d:\d\d:\d\d \d\d\d\d [+-]\d\d\d\d/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
45 syn match gitDate /-\=\d\+ [+-]\d\d\d\d\>/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
46 syn match gitDate /\<\d\+ \l\+ ago\>/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
47 syn match gitType /\<\%(tag\|commit\|tree\|blob\)\>/ contained nextgroup=gitHash skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
48 syn match gitStage /\<\d\t\@=/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
49 syn match gitReference /\S\+\S\@!/ contained
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
50 syn match gitHash /\<\x\{40\}\>/ contained nextgroup=gitIdentity,gitStage,gitHash skipwhite
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
51 syn match gitHash /^\<\x\{40\}\>/ containedin=gitHead contained nextgroup=gitHash skipwhite
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
52 syn match gitHashAbbrev /\<\x\{4,40\}\>/ contained nextgroup=gitHashAbbrev skipwhite
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
53 syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
54
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
55 syn match gitIdentity /\S.\{-\} <[^>]*>/ contained nextgroup=gitDate skipwhite
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
56 syn region gitEmail matchgroup=gitEmailDelimiter start=/</ end=/>/ keepend oneline contained containedin=gitIdentity
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
57
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
58 syn match gitNotesHeader /^Notes:\ze\n /
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
59
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
60 hi def link gitDateHeader gitIdentityHeader
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
61 hi def link gitIdentityHeader gitIdentityKeyword
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
62 hi def link gitIdentityKeyword Label
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
63 hi def link gitNotesHeader gitKeyword
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
64 hi def link gitReflogHeader gitKeyword
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
65 hi def link gitKeyword Keyword
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
66 hi def link gitIdentity String
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
67 hi def link gitEmailDelimiter Delimiter
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
68 hi def link gitEmail Special
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
69 hi def link gitDate Number
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
70 hi def link gitMode Number
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
71 hi def link gitHashAbbrev gitHash
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
72 hi def link gitHash Identifier
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
73 hi def link gitReflogMiddle gitReference
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
74 hi def link gitReference Function
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
75 hi def link gitStage gitType
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
76 hi def link gitType Type
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
77 hi def link gitDiffAdded diffAdded
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
78 hi def link gitDiffRemoved diffRemoved
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
79
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
80 let b:current_syntax = "git"