Mercurial > vim
annotate runtime/syntax/sl.vim @ 16666:978bcd70883d v8.1.1335
patch 8.1.1335: listener callback is called after inserting text
commit https://github.com/vim/vim/commit/dda4144d39a9d685b8dda830978e7410bd372c40
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 16 22:11:47 2019 +0200
patch 8.1.1335: listener callback is called after inserting text
Problem: Listener callback is called after inserting text.
Solution: Flush the changes before inserting or deleting a line. Store
changes per buffer.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 16 May 2019 22:15:06 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Renderman shader language | |
3 " Maintainer: Dan Piponi <dan@tanelorn.demon.co.uk> | |
4 " Last Change: 2001 May 09 | |
5 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
6 " 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
|
7 if exists("b:current_syntax") |
7 | 8 finish |
9 endif | |
10 | |
11 " A bunch of useful Renderman keywords including special | |
12 " RenderMan control structures | |
13 syn keyword slStatement break return continue | |
14 syn keyword slConditional if else | |
15 syn keyword slRepeat while for | |
16 syn keyword slRepeat illuminance illuminate solar | |
17 | |
18 syn keyword slTodo contained TODO FIXME XXX | |
19 | |
20 " String and Character constants | |
21 " Highlight special characters (those which have a backslash) differently | |
22 syn match slSpecial contained "\\[0-9][0-9][0-9]\|\\." | |
23 syn region slString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=slSpecial | |
24 syn match slCharacter "'[^\\]'" | |
25 syn match slSpecialCharacter "'\\.'" | |
26 syn match slSpecialCharacter "'\\[0-9][0-9]'" | |
27 syn match slSpecialCharacter "'\\[0-9][0-9][0-9]'" | |
28 | |
29 "catch errors caused by wrong parenthesis | |
30 syn region slParen transparent start='(' end=')' contains=ALLBUT,slParenError,slIncluded,slSpecial,slTodo,slUserLabel | |
31 syn match slParenError ")" | |
32 syn match slInParen contained "[{}]" | |
33 | |
34 "integer number, or floating point number without a dot and with "f". | |
35 syn case ignore | |
36 syn match slNumber "\<[0-9]\+\(u\=l\=\|lu\|f\)\>" | |
37 "floating point number, with dot, optional exponent | |
38 syn match slFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>" | |
39 "floating point number, starting with a dot, optional exponent | |
40 syn match slFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>" | |
41 "floating point number, without dot, with exponent | |
42 syn match slFloat "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>" | |
43 "hex number | |
44 syn match slNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>" | |
45 "syn match slIdentifier "\<[a-z_][a-z0-9_]*\>" | |
46 syn case match | |
47 | |
48 if exists("sl_comment_strings") | |
49 " A comment can contain slString, slCharacter and slNumber. | |
50 " But a "*/" inside a slString in a slComment DOES end the comment! So we | |
51 " need to use a special type of slString: slCommentString, which also ends on | |
52 " "*/", and sees a "*" at the start of the line as comment again. | |
53 " Unfortunately this doesn't very well work for // type of comments :-( | |
54 syntax match slCommentSkip contained "^\s*\*\($\|\s\+\)" | |
55 syntax region slCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=slSpecial,slCommentSkip | |
56 syntax region slComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=slSpecial | |
57 syntax region slComment start="/\*" end="\*/" contains=slTodo,slCommentString,slCharacter,slNumber | |
58 else | |
59 syn region slComment start="/\*" end="\*/" contains=slTodo | |
60 endif | |
61 syntax match slCommentError "\*/" | |
62 | |
63 syn keyword slOperator sizeof | |
64 syn keyword slType float point color string vector normal matrix void | |
65 syn keyword slStorageClass varying uniform extern | |
66 syn keyword slStorageClass light surface volume displacement transformation imager | |
67 syn keyword slVariable Cs Os P dPdu dPdv N Ng u v du dv s t | |
68 syn keyword slVariable L Cl Ol E I ncomps time Ci Oi | |
69 syn keyword slVariable Ps alpha | |
70 syn keyword slVariable dtime dPdtime | |
71 | |
72 syn sync ccomment slComment minlines=10 | |
73 | |
74 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
75 " Only when an item doesn't have highlighting yet |
7 | 76 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
77 hi def link slLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
78 hi def link slUserLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
79 hi def link slConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
80 hi def link slRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
81 hi def link slCharacter Character |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
82 hi def link slSpecialCharacter slSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
83 hi def link slNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
84 hi def link slFloat Float |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
85 hi def link slParenError slError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
86 hi def link slInParen slError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
87 hi def link slCommentError slError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
88 hi def link slOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
89 hi def link slStorageClass StorageClass |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
90 hi def link slError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
91 hi def link slStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
92 hi def link slType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
93 hi def link slCommentError slError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
94 hi def link slCommentString slString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
95 hi def link slComment2String slString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
96 hi def link slCommentSkip slComment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
97 hi def link slString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
98 hi def link slComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
99 hi def link slSpecial SpecialChar |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
100 hi def link slTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
101 hi def link slVariable Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
102 "hi def link slIdentifier Identifier |
7 | 103 |
104 | |
105 let b:current_syntax = "sl" | |
106 | |
107 " vim: ts=8 |