From 73e8a7806c76190ca796b9db9dd77c1a7b11ad9f Mon Sep 17 00:00:00 2001
From: Grzegorz Szymaszek <gszymaszek@short.pl>
Date: Sat, 4 Dec 2021 23:31:47 +0100
Subject: [PATCH] Fix SPICE syntax file to recognize where control script
context ends
Since .endc was defined both as the context end delimiter and a context
keyword, it was not recognized as the former and the control script
context, once started, would never be finished. This issue can be
noticed, for example, in wrong syntax highlighting of the .end command
if it was preceded by a control script.
Fix the issue by making the control script context exclusive and
highlighting the .control and .endc keywords in the default context
instead.
---
misc/syntax/spice.syntax | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/misc/syntax/spice.syntax b/misc/syntax/spice.syntax
index 15e6aea58..86ff10e4f 100644
a
|
b
|
context default |
9 | 9 | |
10 | 10 | # dot commands |
11 | 11 | keyword whole .ac brightmagenta |
| 12 | keyword whole .control brightmagenta |
12 | 13 | keyword whole .csparam brightmagenta |
13 | 14 | keyword whole .dc brightmagenta |
14 | 15 | keyword whole .disto brightmagenta |
15 | 16 | keyword whole .else brightmagenta |
16 | 17 | keyword whole .elseif brightmagenta |
17 | 18 | keyword whole .end brightmagenta |
| 19 | keyword whole .endc brightmagenta |
18 | 20 | keyword whole .endif brightmagenta |
19 | 21 | keyword whole .ends brightmagenta |
20 | 22 | keyword whole .four brightmagenta |
… |
… |
context default |
186 | 188 | |
187 | 189 | context " " green |
188 | 190 | |
189 | | context .control .endc |
| 191 | context exclusive .control .endc |
190 | 192 | keyword linestart \**\n brown |
191 | 193 | keyword $*\n brown |
192 | 194 | keyword ;*\n brown |
193 | 195 | keyword //*\n brown |
194 | 196 | keyword linestart \+ red |
195 | 197 | |
196 | | keyword .control brightmagenta |
197 | | keyword .endc brightmagenta |
198 | | |
199 | 198 | # commands |
200 | 199 | keyword whole ac yellow |
201 | 200 | keyword whole alias yellow |