diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-02-04 21:06:54 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-02-04 21:06:54 -0800 |
commit | f625db09173f6a0e26bd4c293273899892f3d405 (patch) | |
tree | 785a3820ae20eab2a9487014febfb685d6a7a32d /genvim.txr | |
parent | 16b26a6e5f1e6c29f88e4ab166e7bcafb318ba4b (diff) | |
download | txr-f625db09173f6a0e26bd4c293273899892f3d405.tar.gz txr-f625db09173f6a0e26bd4c293273899892f3d405.tar.bz2 txr-f625db09173f6a0e26bd4c293273899892f3d405.zip |
vim: improvement multi-line strings.
Vim's handling of multi-line Lisp strings is glitchy. We are
contributing to it by tryign to match the backslash-newline as
an escape sequence.
As a result of this change, Vim is less confused. Indentation
is still incorrect after some multi-line strings, but I'm not
seeing the discrepancy between the behavior of the visual
parentheses matching, and the % parentheses jump.
I'm able to navigate around in the stdlib/getopts.tl code.
* genvim.txr (chesc): Remove the backslash-newline from the
list of character escapes.
(txr_string, txr_quasilit, txr_regex, tx_regex): Use skip= to
recognize the backslash-newline sequence as part of the
literal.
Diffstat (limited to 'genvim.txr')
-rw-r--r-- | genvim.txr | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -45,7 +45,7 @@ static void dir_tables_init(void) @(bind dig "0-9") @(bind dig19 "1-9") @(bind oct "0-7") -@(bind chesc `abtnvfre@bs \\n`) +@(bind chesc `abtnvfre@bs `) @(bind glyph `!$%&*+\\-<=>?@{bs}_~`) @(bind lispwords @(append-each ((sym tl-orig-sym) (text tl-sym)) @@ -178,10 +178,10 @@ syn region txr_list @(if txr-p "contained ")matchgroup=Delimiter start="\(#[HSRT syn region txr_bracket @(if txr-p "contained ")matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=@list syn region txr_mlist @(if txr-p "contained ")matchgroup=Delimiter start="@@[ \t^',]*(" matchgroup=Delimiter end=")" contains=@list syn region txr_mbracket matchgroup=Delimiter start="@@[ \t^',]*\[" matchgroup=Delimiter end="\]" contains=@list -syn region txr_string @(if txr-p "contained ")start=+#\?\*\?"+ end=+["\n]+ contains=txr_stresc,txr_numesc,txr_badesc -syn region txr_quasilit @(if txr-p "contained ")start=+#\?\*\?`+ end=+[`\n]+ contains=txr_splicevar,txr_metanum,tl_bracevar,txr_mlist,txr_mbracket,txr_escat,txr_stresc,txr_numesc,txr_badesc -syn region txr_regex @(if txr-p "contained ")start="/" end="[/\n]" contains=txr_regesc,txr_numesc,txr_badesc -syn region tl_regex @(if txr-p "contained ")start="#/" end="[/\n]" contains=txr_regesc,txr_numesc,txr_badesc +syn region txr_string @(if txr-p "contained ")start=+#\?\*\?"+ skip=+\\\n+ end=+["\n]+ contains=txr_stresc,txr_numesc,txr_badesc +syn region txr_quasilit @(if txr-p "contained ")start=+#\?\*\?`+ skip=+\\\n+ end=+[`\n]+ contains=txr_splicevar,txr_metanum,tl_bracevar,txr_mlist,txr_mbracket,txr_escat,txr_stresc,txr_numesc,txr_badesc +syn region txr_regex @(if txr-p "contained ")start="/" skip=+\\\n+ end="[/\n]" contains=txr_regesc,txr_numesc,txr_badesc +syn region tl_regex @(if txr-p "contained ")start="#/" skip=+\\\n+ end="[/\n]" contains=txr_regesc,txr_numesc,txr_badesc syn region txr_buf @(if txr-p "contained ")matchgroup=txr_buf start="#b'" end="'" contains=txr_buf_interior,txr_buf_error syn region txr_ign_tok @(if txr-p "contained ")matchgroup=Comment start="#;" end="[ \(\)\[\]]"me=e contains=@list syn region txr_ign_par @(if txr-p "contained ")matchgroup=Comment start="#;[ \t',]*\(#[HSRTN]\?\)\?(" matchgroup=Comment end=")" contains=txr_ign_par_interior,txr_ign_bkt_interior |