annotate runtime/syntax/mermaid.vim @ 32196:d6771e63521c v9.0.1429

patch 9.0.1429: invalid memory access when ending insert mode Commit: https://github.com/vim/vim/commit/1a08a3e2a584889f19b84a27672134649b73da58 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 26 21:27:24 2023 +0100 patch 9.0.1429: invalid memory access when ending insert mode Problem: Invalid memory access when ending insert mode. Solution: Check if the insert_skip value is valid.
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Mar 2023 22:30:04 +0200
parents a7801222c9c5
children 681a291388d5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31200
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: Mermaid
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: Craig MacEahern <https://github.com/craigmac/vim-mermaid>
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Filenames: *.mmd
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " Last Change: 2022 Nov 22
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 if exists("b:current_syntax")
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 finish
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 endif
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 let s:cpo_save = &cpo
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 set cpo&vim
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 syntax iskeyword @,48-57,192-255,$,_,-,:
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 syntax keyword mermaidKeyword
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 \ _blank
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 \ _self
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 \ _parent
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 \ _top
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 \ ::icon
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 \ accDescr
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 \ accTitle
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 \ actor
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 \ activate
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 \ alt
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 \ and
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 \ as
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 \ autonumber
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 \ branch
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 \ break
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 \ callback
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 \ checkout
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 \ class
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 \ classDef
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 \ classDiagram
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 \ click
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 \ commit
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 \ commitgitGraph
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 \ critical
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 \ dataFormat
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 \ dateFormat
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 \ deactivate
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 \ direction
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 \ element
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 \ else
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 \ end
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 \ erDiagram
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 \ flowchart
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 \ gantt
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 \ gitGraph
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 \ graph
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 \ journey
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 \ link
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 \ LR
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 \ TD
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 \ TB
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 \ RL
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 \ loop
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 \ merge
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 \ mindmap root
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 \ Note
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 \ Note right of
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 \ Note left of
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 \ Note over
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 \ note
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 \ note right of
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 \ note left of
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 \ note over
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 \ opt
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 \ option
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 \ par
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 \ participant
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 \ pie
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 \ rect
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 \ requirement
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 \ rgb
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 \ section
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 \ sequenceDiagram
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 \ state
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 \ stateDiagram
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 \ stateDiagram-v2
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 \ style
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 \ subgraph
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 \ title
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 highlight link mermaidKeyword Keyword
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 syntax match mermaidStatement "|"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 syntax match mermaidStatement "--\?[>x)]>\?+\?-\?"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 syntax match mermaidStatement "\~\~\~"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 syntax match mermaidStatement "--"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 syntax match mermaidStatement "---"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 syntax match mermaidStatement "-->"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 syntax match mermaidStatement "-\."
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 syntax match mermaidStatement "\.->"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 syntax match mermaidStatement "-\.-"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 syntax match mermaidStatement "-\.\.-"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 syntax match mermaidStatement "-\.\.\.-"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 syntax match mermaidStatement "=="
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 syntax match mermaidStatement "==>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 syntax match mermaidStatement "===>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 syntax match mermaidStatement "====>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 syntax match mermaidStatement "&"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 syntax match mermaidStatement "--o"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 syntax match mermaidStatement "--x"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 syntax match mermaidStatement "x--x"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 syntax match mermaidStatement "-----"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 syntax match mermaidStatement "---->"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 syntax match mermaidStatement "==="
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 syntax match mermaidStatement "===="
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 syntax match mermaidStatement "====="
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 syntax match mermaidStatement ":::"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 syntax match mermaidStatement "<|--"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 syntax match mermaidStatement "\*--"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 syntax match mermaidStatement "o--"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 syntax match mermaidStatement "o--o"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 syntax match mermaidStatement "<--"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 syntax match mermaidStatement "<-->"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 syntax match mermaidStatement "\.\."
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 syntax match mermaidStatement "<\.\."
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 syntax match mermaidStatement "<|\.\."
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 syntax match mermaidStatement "--|>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 syntax match mermaidStatement "--\*"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 syntax match mermaidStatement "--o"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 syntax match mermaidStatement "\.\.>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125 syntax match mermaidStatement "\.\.|>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 syntax match mermaidStatement "<|--|>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 syntax match mermaidStatement "||--o{"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128 highlight link mermaidStatement Statement
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 syntax match mermaidIdentifier "[\+-]\?\w\+(.*)[\$\*]\?"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131 highlight link mermaidIdentifier Identifier
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
133 syntax match mermaidType "[\+-\#\~]\?\cint\>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
134 syntax match mermaidType "[\+-\#\~]\?\cString\>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135 syntax match mermaidType "[\+-\#\~]\?\cbool\>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
136 syntax match mermaidType "[\+-\#\~]\?\cBigDecimal\>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 syntax match mermaidType "[\+-\#\~]\?\cList\~.\+\~"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138 syntax match mermaidType "<<\w\+>>"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 highlight link mermaidType Type
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
141 syntax match mermaidComment "%%.*$"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 highlight link mermaidComment Comment
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144 syntax region mermaidDirective start="%%{" end="\}%%"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 highlight link mermaidDirective PreProc
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 syntax region mermaidString start=/"/ skip=/\\"/ end=/"/
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 highlight link mermaidString String
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150 let b:current_syntax = "mermaid"
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
152 let &cpo = s:cpo_save
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
153 unlet s:cpo_save
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
154
a7801222c9c5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
155 " vim:set sw=2: