summaryrefslogtreecommitdiffstats
path: root/genvim.txr
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-24 22:45:15 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-24 22:45:15 -0700
commit7d4b1267108e6e0d3363124197fe9ea5bfb2d21d (patch)
treed42b5540ca52caa4c58a9cf66b6802fbff7a63b8 /genvim.txr
parent817cd5991d6304a2368824acbfc0b0e95c2aa7a7 (diff)
downloadtxr-7d4b1267108e6e0d3363124197fe9ea5bfb2d21d.tar.gz
txr-7d4b1267108e6e0d3363124197fe9ea5bfb2d21d.tar.bz2
txr-7d4b1267108e6e0d3363124197fe9ea5bfb2d21d.zip
vim: improve json unquote situation.
* genvim.txr (jlist): Include txr_junqtok. (txr_junqtok): New region. Provides okay-ish match for ~ followed by unparenthesized Lisp item. For some reason, keywords aren't lit up specially, but it's still an improvement over just flagging everything as an error.
Diffstat (limited to 'genvim.txr')
-rw-r--r--genvim.txr3
1 files changed, 2 insertions, 1 deletions
diff --git a/genvim.txr b/genvim.txr
index ca4e0d06..177fe9b4 100644
--- a/genvim.txr
+++ b/genvim.txr
@@ -79,7 +79,7 @@ static void dir_tables_init(void)
txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_circ,txr_jhash,\
txr_jarray,txr_jatom,txr_ncomment,txr_nested_error")
@(bind jlist "txr_jarray_in,txr_jhash_in,txr_jkeyword,txr_jstring,\
- txr_jnum,txr_jpunc,txr_junqlist,txr_junqbkt,\
+ txr_jnum,txr_jpunc,txr_junqlist,txr_junqbkt,txr_junqtok,\
txr_circ,txr_jerr")
@(bind jsonkw #"true false null")
@(bind jerr ".")
@@ -199,6 +199,7 @@ syn match txr_jnum "@jnum" contained
syn match txr_jkeyword "@(join-with "\\|" . jsonkw)" contained
syn region txr_jatom @(if txr-p "contained ")matchgroup=Delimiter start="#J\^\?@ws*"rs=e end="@ws\|[\])}]"re=e-1 contains=@jlist
+syn region txr_junqtok @(if txr-p "contained ")matchgroup=Delimiter start="\~" end="[ \(\)\[\]{}]"re=s contains=@list
syn region txr_junqlist @(if txr-p "contained ")matchgroup=Delimiter start="\~\*\?#\?(" end=")" contains=@list
syn region txr_junqbkt @(if txr-p "contained ")matchgroup=Delimiter start="\~\*\?\[" end="\]" contains=@list
syn region txr_jstring @(if txr-p "contained ")matchgroup=Delimiter start=+"+ end=+["\n]+ contains=txr_jesc,txr_juesc,txr_badesc