Mercurial > vim
annotate runtime/syntax/tf.vim @ 18957:305a7a8d9d4b v8.2.0039
patch 8.2.0039: memory access error when "z=" has no suggestions
Commit: https://github.com/vim/vim/commit/569fea2c312126dd5a542c4b1aa51095136a2c0d
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Dec 25 13:55:24 2019 +0100
patch 8.2.0039: memory access error when "z=" has no suggestions
Problem: Memory access error when "z=" has no suggestions.
Solution: Check for negative index.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 25 Dec 2019 14:00:04 +0100 |
parents | 46763b01cd9a |
children | d46f974fd69e |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: tf | |
3 " Maintainer: Lutz Eymers <ixtab@polzin.com> | |
4 " URL: http://www.isp.de/data/tf.vim | |
5 " Email: send syntax_vim.tgz | |
6 " Last Change: 2001 May 10 | |
7 " | |
8 " Options lite_minlines = x to sync at least x lines backwards | |
9 | |
10 " Remove any old syntax stuff hanging around | |
11 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
12 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
13 if exists("b:current_syntax") |
7 | 14 finish |
15 endif | |
16 | |
17 syn case match | |
18 | |
19 if !exists("main_syntax") | |
20 let main_syntax = 'tf' | |
21 endif | |
22 | |
23 " Special global variables | |
24 syn keyword tfVar HOME LANG MAIL SHELL TERM TFHELP TFLIBDIR TFLIBRARY TZ contained | |
25 syn keyword tfVar background backslash contained | |
26 syn keyword tfVar bamf bg_output borg clearfull cleardone clock connect contained | |
27 syn keyword tfVar emulation end_color gag gethostbyname gpri hook hilite contained | |
28 syn keyword tfVar hiliteattr histsize hpri insert isize istrip kecho contained | |
29 syn keyword tfVar kprefix login lp lpquote maildelay matching max_iter contained | |
30 syn keyword tfVar max_recur mecho more mprefix oldslash promt_sec contained | |
31 syn keyword tfVar prompt_usec proxy_host proxy_port ptime qecho qprefix contained | |
32 syn keyword tfVar quite quitdone redef refreshtime scroll shpause snarf sockmload contained | |
33 syn keyword tfVar start_color tabsize telopt sub time_format visual contained | |
34 syn keyword tfVar watch_dog watchname wordpunct wrap wraplog wrapsize contained | |
35 syn keyword tfVar wrapspace contained | |
36 | |
37 " Worldvar | |
38 syn keyword tfWorld world_name world_character world_password world_host contained | |
39 syn keyword tfWorld world_port world_mfile world_type contained | |
40 | |
41 " Number | |
42 syn match tfNumber "-\=\<\d\+\>" | |
43 | |
44 " Float | |
45 syn match tfFloat "\(-\=\<\d+\|-\=\)\.\d\+\>" | |
46 | |
47 " Operator | |
48 syn match tfOperator "[-+=?:&|!]" | |
49 syn match tfOperator "/[^*~@]"he=e-1 | |
50 syn match tfOperator ":=" | |
51 syn match tfOperator "[^/%]\*"hs=s+1 | |
52 syn match tfOperator "$\+[([{]"he=e-1,me=e-1 | |
53 syn match tfOperator "\^\[\+"he=s+1 contains=tfSpecialCharEsc | |
54 | |
55 " Relational | |
56 syn match tfRelation "&&" | |
57 syn match tfRelation "||" | |
58 syn match tfRelation "[<>/!=]=" | |
59 syn match tfRelation "[<>]" | |
60 syn match tfRelation "[!=]\~" | |
61 syn match tfRelation "[=!]/" | |
62 | |
63 | |
64 " Readonly Var | |
65 syn match tfReadonly "[#*]" contained | |
66 syn match tfReadonly "\<-\=L\=\d\{-}\>" contained | |
67 syn match tfReadonly "\<P\(\d\+\|R\|L\)\>" contained | |
68 syn match tfReadonly "\<R\>" contained | |
69 | |
70 " Identifier | |
71 syn match tfIdentifier "%\+[a-zA-Z_#*-0-9]\w*" contains=tfVar,tfReadonly | |
72 syn match tfIdentifier "%\+[{]"he=e-1,me=e-1 | |
73 syn match tfIdentifier "\$\+{[a-zA-Z_#*-0-9]\w*}" contains=tfWorld | |
74 | |
75 " Function names | |
76 syn keyword tfFunctions ascii char columns echo filename ftime fwrite getopts | |
77 syn keyword tfFunctions getpid idle kbdel kbgoto kbhead kblen kbmatch kbpoint | |
78 syn keyword tfFunctions kbtail kbwordleft kbwordright keycode lines mod | |
79 syn keyword tfFunctions moresize pad rand read regmatch send strcat strchr | |
80 syn keyword tfFunctions strcmp strlen strncmp strrchr strrep strstr substr | |
81 syn keyword tfFunctions systype time tolower toupper | |
82 | |
83 syn keyword tfStatement addworld bamf beep bind break cat changes connect contained | |
84 syn keyword tfStatement dc def dokey echo edit escape eval export expr fg for contained | |
85 syn keyword tfStatement gag getfile grab help hilite histsize hook if input contained | |
86 syn keyword tfStatement kill lcd let list listsockets listworlds load contained | |
87 syn keyword tfStatement localecho log nohilite not partial paste ps purge contained | |
88 syn keyword tfStatement purgeworld putfile quit quote recall recordline save contained | |
89 syn keyword tfStatement saveworld send sh shift sub substitute contained | |
90 syn keyword tfStatement suspend telnet test time toggle trig trigger unbind contained | |
91 syn keyword tfStatement undef undefn undeft unhook untrig unworld contained | |
92 syn keyword tfStatement version watchdog watchname while world contained | |
93 | |
94 " Hooks | |
95 syn keyword tfHook ACTIVITY BACKGROUND BAMF CONFAIL CONFLICT CONNECT DISCONNECT | |
96 syn keyword tfHook KILL LOAD LOADFAIL LOG LOGIN MAIL MORE PENDING PENDING | |
97 syn keyword tfHook PROCESS PROMPT PROXY REDEF RESIZE RESUME SEND SHADOW SHELL | |
98 syn keyword tfHook SIGHUP SIGTERM SIGUSR1 SIGUSR2 WORLD | |
99 | |
100 " Conditional | |
101 syn keyword tfConditional if endif then else elseif contained | |
102 | |
103 " Repeat | |
104 syn keyword tfRepeat while do done repeat for contained | |
105 | |
106 " Statement | |
107 syn keyword tfStatement break quit contained | |
108 | |
109 " Include | |
110 syn keyword tfInclude require load save loaded contained | |
111 | |
112 " Define | |
113 syn keyword tfDefine bind unbind def undef undefn undefn purge hook unhook trig untrig contained | |
114 syn keyword tfDefine set unset setenv contained | |
115 | |
116 " Todo | |
117 syn keyword tfTodo TODO Todo todo contained | |
118 | |
119 " SpecialChar | |
120 syn match tfSpecialChar "\\[abcfnrtyv\\]" contained | |
121 syn match tfSpecialChar "\\\d\{3}" contained contains=tfOctalError | |
122 syn match tfSpecialChar "\\x[0-9a-fA-F]\{2}" contained | |
123 syn match tfSpecialCharEsc "\[\+" contained | |
124 | |
125 syn match tfOctalError "[89]" contained | |
126 | |
127 " Comment | |
128 syn region tfComment start="^;" end="$" contains=tfTodo | |
129 | |
130 " String | |
131 syn region tfString oneline matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=tfIdentifier,tfSpecialChar,tfEscape | |
132 syn region tfString matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=tfIdentifier,tfSpecialChar,tfEscape | |
133 | |
134 syn match tfParentError "[)}\]]" | |
135 | |
136 " Parents | |
137 syn region tfParent matchgroup=Delimiter start="(" end=")" contains=ALLBUT,tfReadonly | |
138 syn region tfParent matchgroup=Delimiter start="\[" end="\]" contains=ALL | |
139 syn region tfParent matchgroup=Delimiter start="{" end="}" contains=ALL | |
140 | |
141 syn match tfEndCommand "%%\{-};" | |
142 syn match tfJoinLines "\\$" | |
143 | |
144 " Types | |
145 | |
146 syn match tfType "/[a-zA-Z_~@][a-zA-Z0-9_]*" contains=tfConditional,tfRepeat,tfStatement,tfInclude,tfDefine,tfStatement | |
147 | |
148 " Catch /quote .. ' | |
149 syn match tfQuotes "/quote .\{-}'" contains=ALLBUT,tfString | |
150 " Catch $(/escape ) | |
151 syn match tfEscape "(/escape .*)" | |
152 | |
153 " sync | |
154 if exists("tf_minlines") | |
155 exec "syn sync minlines=" . tf_minlines | |
156 else | |
157 syn sync minlines=100 | |
158 endif | |
159 | |
160 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
161 " Only when an item doesn't have highlighting yet |
7 | 162 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
163 hi def link tfComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
164 hi def link tfString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
165 hi def link tfNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
166 hi def link tfFloat Float |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
167 hi def link tfIdentifier Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
168 hi def link tfVar Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
169 hi def link tfWorld Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
170 hi def link tfReadonly Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
171 hi def link tfHook Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
172 hi def link tfFunctions Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
173 hi def link tfRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
174 hi def link tfConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
175 hi def link tfLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
176 hi def link tfStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
177 hi def link tfType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
178 hi def link tfInclude Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
179 hi def link tfDefine Define |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
180 hi def link tfSpecialChar SpecialChar |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
181 hi def link tfSpecialCharEsc SpecialChar |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
182 hi def link tfParentError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
183 hi def link tfTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
184 hi def link tfEndCommand Delimiter |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
185 hi def link tfJoinLines Delimiter |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
186 hi def link tfOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
187 hi def link tfRelation Operator |
7 | 188 |
189 | |
190 let b:current_syntax = "tf" | |
191 | |
192 if main_syntax == 'tf' | |
193 unlet main_syntax | |
194 endif | |
195 | |
196 " vim: ts=8 |