Mercurial > vim
annotate runtime/syntax/make.vim @ 14538:213f1a519378 v8.1.0282
patch 8.1.0282: 'incsearch' does not work with command modifiers
commit https://github.com/vim/vim/commit/33c4dbb74bdf41aadd193a704f597d4df20f0e47
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 14 16:06:16 2018 +0200
patch 8.1.0282: 'incsearch' does not work with command modifiers
Problem: 'incsearch' does not work with command modifiers.
Solution: Skip command modifiers.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 14 Aug 2018 16:15:04 +0200 |
parents | 46763b01cd9a |
children | 314694a2e74a |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Makefile | |
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com> | |
4 " URL: http://www.fleiner.com/vim/syntax/make.vim | |
6647 | 5 " Last Change: 2015 Feb 28 |
7 | 6 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6647
diff
changeset
|
7 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6647
diff
changeset
|
8 if exists("b:current_syntax") |
7 | 9 finish |
10 endif | |
11 | |
3854 | 12 let s:cpo_save = &cpo |
13 set cpo&vim | |
14 | |
15 | |
7 | 16 " some special characters |
820 | 17 syn match makeSpecial "^\s*[@+-]\+" |
7 | 18 syn match makeNextLine "\\\n\s*" |
19 | |
20 " some directives | |
820 | 21 syn match makePreCondit "^ *\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)" |
22 syn match makeInclude "^ *[-s]\=include" | |
23 syn match makeStatement "^ *vpath" | |
24 syn match makeExport "^ *\(export\|unexport\)\>" | |
25 syn match makeOverride "^ *override" | |
7 | 26 hi link makeOverride makeStatement |
27 hi link makeExport makeStatement | |
28 | |
3854 | 29 " catch unmatched define/endef keywords. endef only matches it is by itself on a line, possibly followed by a commend |
30 syn region makeDefine start="^\s*define\s" end="^\s*endef\s*\(#.*\)\?$" contains=makeStatement,makeIdent,makePreCondit,makeDefine | |
7 | 31 |
32 " Microsoft Makefile specials | |
33 syn case ignore | |
820 | 34 syn match makeInclude "^! *include" |
35 syn match makePreCondit "! *\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|elseif\|else if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>" | |
7 | 36 syn case match |
37 | |
38 " identifiers | |
39 syn region makeIdent start="\$(" skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeSString,makeDString | |
40 syn region makeIdent start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString | |
41 syn match makeIdent "\$\$\w*" | |
42 syn match makeIdent "\$[^({]" | |
6647 | 43 syn match makeIdent "^ *[^:#= \t]*\s*[:+?!*]="me=e-2 |
44 syn match makeIdent "^ *[^:#= \t]*\s*="me=e-1 | |
7 | 45 syn match makeIdent "%" |
46 | |
47 " Makefile.in variables | |
48 syn match makeConfig "@[A-Za-z0-9_]\+@" | |
49 | |
50 " make targets | |
51 " syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>" | |
3854 | 52 syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSource |
7 | 53 syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource |
54 | |
6647 | 55 syn region makeTarget transparent matchgroup=makeTarget start="^[~A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands |
56 syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget,makeComment skipnl nextgroup=makeCommands,makeCommandError | |
7 | 57 |
6647 | 58 syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands |
59 syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$" contains=makeIdent,makeComment skipnl nextgroup=makeCommands,makeCommandError | |
7 | 60 |
61 syn match makeCommandError "^\s\+\S.*" contained | |
62 syn region makeCommands start=";"hs=s+1 start="^\t" end="^[^\t#]"me=e-1,re=e-1 end="^$" contained contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString nextgroup=makeCommandError | |
63 syn match makeCmdNextLine "\\\n."he=e-1 contained | |
64 | |
65 | |
66 " Statements / Functions (GNU make) | |
1698 | 67 syn match makeStatement contained "(\(subst\|abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|if\|info\|join\|lastword\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1 |
7 | 68 |
69 " Comment | |
70 if exists("make_microsoft") | |
1121 | 71 syn match makeComment "#.*" contains=@Spell,makeTodo |
820 | 72 elseif !exists("make_no_comments") |
1121 | 73 syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=@Spell,makeTodo |
74 syn match makeComment "#$" contains=@Spell | |
7 | 75 endif |
76 syn keyword makeTodo TODO FIXME XXX contained | |
77 | |
78 " match escaped quotes and any other escaped character | |
79 " except for $, as a backslash in front of a $ does | |
80 " not make it a standard character, but instead it will | |
81 " still act as the beginning of a variable | |
82 " The escaped char is not highlightet currently | |
83 syn match makeEscapedChar "\\[^$]" | |
84 | |
85 | |
86 syn region makeDString start=+\(\\\)\@<!"+ skip=+\\.+ end=+"+ contains=makeIdent | |
87 syn region makeSString start=+\(\\\)\@<!'+ skip=+\\.+ end=+'+ contains=makeIdent | |
88 syn region makeBString start=+\(\\\)\@<!`+ skip=+\\.+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine | |
89 | |
90 " Syncing | |
91 syn sync minlines=20 maxlines=200 | |
92 | |
93 " Sync on Make command block region: When searching backwards hits a line that | |
94 " can't be a command or a comment, use makeCommands if it looks like a target, | |
95 " NONE otherwise. | |
96 syn sync match makeCommandSync groupthere NONE "^[^\t#]" | |
97 syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]" | |
98 syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}\s*$" | |
99 | |
100 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6647
diff
changeset
|
101 " Only when an item doesn't have highlighting yet |
7 | 102 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
103 hi def link makeNextLine makeSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
104 hi def link makeCmdNextLine makeSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
105 hi def link makeSpecTarget Statement |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
6647
diff
changeset
|
106 if !exists("make_no_commands") |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
107 hi def link makeCommands Number |
7 | 108 endif |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
109 hi def link makeImplicit Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
110 hi def link makeTarget Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
111 hi def link makeInclude Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
112 hi def link makePreCondit PreCondit |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
113 hi def link makeStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
114 hi def link makeIdent Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
115 hi def link makeSpecial Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
116 hi def link makeComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
117 hi def link makeDString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
118 hi def link makeSString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
119 hi def link makeBString Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
120 hi def link makeError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
121 hi def link makeTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
122 hi def link makeDefine Define |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
123 hi def link makeCommandError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
124 hi def link makeConfig PreCondit |
7 | 125 |
126 let b:current_syntax = "make" | |
127 | |
3854 | 128 let &cpo = s:cpo_save |
129 unlet s:cpo_save | |
7 | 130 " vim: ts=8 |