Mercurial > vim
annotate runtime/syntax/natural.vim @ 29655:53e434838a85 v9.0.0168
patch 9.0.0168: cursor positioned wrong with two virtual text properties
Commit: https://github.com/vim/vim/commit/25463610dfc7a4984f70b030463fb98b09772ad9
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 8 11:07:47 2022 +0100
patch 9.0.0168: cursor positioned wrong with two virtual text properties
Problem: Cursor positioned wrong with two virtual text properties close
together. (Ben Jackson)
Solution: Add the original size, not the computed one. (closes #10864)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 08 Aug 2022 12:15:06 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " | |
1698 | 3 " Language: NATURAL |
3356 | 4 " Version: 2.1.0.5 |
1698 | 5 " Maintainer: Marko von Oppen <marko@von-oppen.com> |
3356 | 6 " Last Changed: 2012-02-05 18:50:43 |
1698 | 7 " Support: http://www.von-oppen.com/ |
7 | 8 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3356
diff
changeset
|
9 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3356
diff
changeset
|
10 if exists("b:current_syntax") |
1698 | 11 finish |
7 | 12 endif |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3356
diff
changeset
|
13 setlocal iskeyword+=-,*,#,+,_,/ |
7 | 14 |
3356 | 15 let s:cpo_save = &cpo |
16 set cpo&vim | |
17 | |
7 | 18 " NATURAL is case insensitive |
19 syntax case ignore | |
20 | |
21 " preprocessor | |
1698 | 22 syn keyword naturalInclude include nextgroup=naturalObjName skipwhite |
7 | 23 |
24 " define data | |
1698 | 25 syn keyword naturalKeyword define data end-define |
26 syn keyword naturalKeyword independent global parameter local redefine view | |
27 syn keyword naturalKeyword const[ant] init initial | |
7 | 28 |
29 " loops | |
1698 | 30 syn keyword naturalLoop read end-read end-work find end-find histogram end-histogram |
31 syn keyword naturalLoop end-all sort end-sort sorted descending ascending | |
32 syn keyword naturalRepeat repeat end-repeat while until for step end-for | |
33 syn keyword naturalKeyword in file with field starting from ending at thru by isn where | |
34 syn keyword naturalError on error end-error | |
35 syn keyword naturalKeyword accept reject end-enddata number unique retain as release | |
36 syn keyword naturalKeyword start end-start break end-break physical page top sequence | |
37 syn keyword naturalKeyword end-toppage end-endpage end-endfile before processing | |
38 syn keyword naturalKeyword end-before | |
7 | 39 |
40 " conditionals | |
41 syn keyword naturalConditional if then else end-if end-norec | |
42 syn keyword naturalConditional decide end-decide value when condition none any | |
43 | |
44 " assignment / calculation | |
1698 | 45 syn keyword naturalKeyword reset assign move left right justified compress to into edited |
46 syn keyword naturalKeyword add subtract multiply divide compute name | |
47 syn keyword naturalKeyword all giving remainder rounded leaving space numeric | |
48 syn keyword naturalKeyword examine full replace giving separate delimiter modified | |
49 syn keyword naturalKeyword suspend identical suppress | |
7 | 50 |
51 " program flow | |
1698 | 52 syn keyword naturalFlow callnat fetch return enter escape bottom top stack formatted |
53 syn keyword naturalFlow command call | |
54 syn keyword naturalflow end-subroutine routine | |
7 | 55 |
56 " file operations | |
1698 | 57 syn keyword naturalKeyword update store get delete end transaction work once close |
7 | 58 |
59 " other keywords | |
1698 | 60 syn keyword naturalKeyword first every of no record[s] found ignore immediate |
61 syn keyword naturalKeyword set settime key control stop terminate | |
7 | 62 |
63 " in-/output | |
1698 | 64 syn keyword naturalKeyword write display input reinput notitle nohdr map newpage |
65 syn keyword naturalKeyword alarm text help eject index window base size | |
66 syn keyword naturalKeyword format printer skip lines | |
7 | 67 |
68 " functions | |
1698 | 69 syn keyword naturalKeyword abs atn cos exp frac int log sgn sin sqrt tan val old |
70 syn keyword naturalKeyword pos | |
7 | 71 |
72 " report mode keywords | |
73 syn keyword naturalRMKeyword same loop obtain indexed do doend | |
74 | |
75 " Subroutine name | |
1698 | 76 syn keyword naturalFlow perform subroutine nextgroup=naturalFunction skipwhite |
77 syn match naturalFunction "\<[a-z][-_a-z0-9]*\>" | |
7 | 78 |
1698 | 79 syn keyword naturalFlow using nextgroup=naturalKeyword,naturalObjName skipwhite |
80 syn match naturalObjName "\<[a-z][-_a-z0-9]\{,7}\>" | |
7 | 81 |
82 " Labels | |
1698 | 83 syn match naturalLabel "\<[+#a-z][-_#a-z0-9]*\." |
84 syn match naturalRef "\<[+#a-z][-_#a-z0-9]*\>\.\<[+#a-z][*]\=[-_#a-z0-9]*\>" | |
85 | |
86 " mark keyword special handling | |
87 syn keyword naturalKeyword mark nextgroup=naturalMark skipwhite | |
88 syn match naturalMark "\<\*[a-z][-_#.a-z0-9]*\>" | |
7 | 89 |
90 " System variables | |
1698 | 91 syn match naturalSysVar "\<\*[a-z][-a-z0-9]*\>" |
7 | 92 |
93 "integer number, or floating point number without a dot. | |
1698 | 94 syn match naturalNumber "\<-\=\d\+\>" |
7 | 95 "floating point number, with dot |
1698 | 96 syn match naturalNumber "\<-\=\d\+\.\d\+\>" |
7 | 97 "floating point number, starting with a dot |
1698 | 98 syn match naturalNumber "\.\d\+" |
7 | 99 |
100 " Formats in write statement | |
1698 | 101 syn match naturalFormat "\<\d\+[TX]\>" |
7 | 102 |
103 " String and Character contstants | |
1698 | 104 syn match naturalString "H'\x\+'" |
105 syn region naturalString start=+"+ end=+"+ | |
106 syn region naturalString start=+'+ end=+'+ | |
7 | 107 |
108 " Type definition | |
1698 | 109 syn match naturalAttribute "\<[-a-z][a-z]=[-a-z0-9_\.,]\+\>" |
110 syn match naturalType contained "\<[ABINP]\d\+\(,\d\+\)\=\>" | |
111 syn match naturalType contained "\<[CL]\>" | |
7 | 112 |
113 " "TODO" / other comments | |
1698 | 114 syn keyword naturalTodo contained todo test |
115 syn match naturalCommentMark contained "[a-z][^ \t/:|]*\(\s[^ \t/:'"|]\+\)*:\s"he=e-1 | |
7 | 116 |
117 " comments | |
1698 | 118 syn region naturalComment start="/\*" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark |
119 syn region naturalComment start="^\*[ *]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | |
120 syn region naturalComment start="^\d\{4} \*[\ \*]"lc=5 end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark | |
121 syn match naturalComment "^\*$" | |
122 syn match naturalComment "^\d\{4} \*$"lc=5 | |
7 | 123 " /* is legal syntax in parentheses e.g. "#ident(label./*)" |
1698 | 124 syn region naturalPComment contained start="/\*\s*[^),]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark |
7 | 125 |
126 " operators | |
1698 | 127 syn keyword naturalOperator and or not eq ne gt lt ge le mask scan modified |
7 | 128 |
129 " constants | |
1698 | 130 syn keyword naturalBoolean true false |
131 syn match naturalLineNo "^\d\{4}" | |
7 | 132 |
133 " identifiers | |
1698 | 134 syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*\>[^\.']"me=e-1 |
135 syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*$" | |
136 syn match naturalLegalIdent "[+#a-z][-_#a-z0-9]*/[-_#a-z0-9]*" | |
7 | 137 |
138 " parentheses | |
1698 | 139 syn region naturalPar matchgroup=naturalParGui start="(" end=")" contains=naturalLabel,naturalRef,naturalOperator,@naturalConstant,naturalType,naturalSysVar,naturalPar,naturalLineNo,naturalPComment |
140 syn match naturalLineRef "(\d\{4})" | |
7 | 141 |
142 " build syntax groups | |
143 syntax cluster naturalConstant contains=naturalString,naturalNumber,naturalAttribute,naturalBoolean | |
144 | |
145 " folding | |
146 if v:version >= 600 | |
1698 | 147 set foldignore=* |
7 | 148 endif |
149 | |
150 | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
151 " The default methods for highlighting. Can be overridden later |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
152 |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
153 " Constants |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
154 hi def link naturalFormat Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
155 hi def link naturalAttribute Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
156 hi def link naturalNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
157 hi def link naturalString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
158 hi def link naturalBoolean Boolean |
7 | 159 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
160 " All kinds of keywords |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
161 hi def link naturalConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
162 hi def link naturalRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
163 hi def link naturalLoop Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
164 hi def link naturalFlow Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
165 hi def link naturalError Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
166 hi def link naturalKeyword Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
167 hi def link naturalOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
168 hi def link naturalParGui Operator |
7 | 169 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
170 " Labels |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
171 hi def link naturalLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
172 hi def link naturalRefLabel Label |
7 | 173 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
174 " Comments |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
175 hi def link naturalPComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
176 hi def link naturalComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
177 hi def link naturalTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
178 hi def link naturalCommentMark PreProc |
7 | 179 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
180 hi def link naturalInclude Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
181 hi def link naturalSysVar Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
182 hi def link naturalLineNo LineNr |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
183 hi def link naturalLineRef Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
184 hi def link naturalSpecial Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
185 hi def link naturalComKey Todo |
7 | 186 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
187 " illegal things |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
188 hi def link naturalRMKeyword Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
189 hi def link naturalLegalIdent Error |
7 | 190 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
191 hi def link naturalType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
192 hi def link naturalFunction Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
193 hi def link naturalObjName PreProc |
7 | 194 |
195 | |
196 let b:current_syntax = "natural" | |
197 | |
3356 | 198 let &cpo = s:cpo_save |
199 unlet s:cpo_save | |
200 | |
201 " vim:set ts=8 sw=8 noet ft=vim list: |