From b7bd624130c9d6e72e0fa4651f80aead3362babf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20BURGHARD?= Date: Fri, 24 Jun 2022 10:58:22 +0200 Subject: [PATCH 01/10] feat: highlight latex3 functions, variables and lists --- rc/filetype/latex.kak | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index a3c05d51..9056d078 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -35,8 +35,19 @@ add-highlighter shared/latex regions add-highlighter shared/latex/content default-region group add-highlighter shared/latex/comment region '(? Date: Fri, 24 Jun 2022 17:32:15 +0200 Subject: [PATCH 02/10] feat: add l3kernel modules names and types in regex. dim module, scope and type parts --- rc/filetype/latex.kak | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index 9056d078..4dbb74b4 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -39,14 +39,18 @@ add-highlighter shared/latex/comment region '(? Date: Sat, 25 Jun 2022 10:26:27 +0200 Subject: [PATCH 03/10] fix: check for escaped # and {. highlight nested arg (##1) --- rc/filetype/latex.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index 4dbb74b4..cd4a4e01 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -48,9 +48,9 @@ add-highlighter shared/latex/content/ regex '_(bool|box|cctab|clist|coffin|dim|f # latex3 l3kernel modules (l3kernel/doc/l3prefixes.csv) add-highlighter shared/latex/content/ regex '\\(alignment|alloc|ampersand|atsign|backslash|bitset|bool|box|catcode|cctab|char|chk|circumflex|clist|code|codedoc|coffin|colon|color|cs|debug|dim|document|dollar|driver|e|else|empty|etex|exp|expl|false|fi|file|flag|fp|group|hash|hbox|hcoffin|if|inf|initex|insert|int|intarray|ior|iow|job|kernel|keys|keyval|left|log|lua|luatex|mark|marks|math|max|minus|mode|msg|muskip|nan|nil|no|novalue|one|or|other|parameter|pdf|pdftex|peek|percent|pi|prg|prop|ptex|quark|recursion|ref|regex|reverse|right|scan|seq|skip|sort|space|stop|str|sys|tag|term|tex|text|tilde|tl|tmpa|tmpb|token|true|underscore|uptex|use|utex|vbox|vcoffin|xetex|zero)_' 0:+db # macros arguments -add-highlighter shared/latex/content/ regex '#[1-9]\b' 0:string +add-highlighter shared/latex/content/ regex '(? Date: Sun, 26 Jun 2022 09:50:09 +0200 Subject: [PATCH 04/10] fix: comment after double \ --- rc/filetype/latex.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index cd4a4e01..bfa70f39 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -33,7 +33,7 @@ provide-module latex %~ add-highlighter shared/latex regions add-highlighter shared/latex/content default-region group -add-highlighter shared/latex/comment region '(? Date: Sun, 26 Jun 2022 21:40:56 +0200 Subject: [PATCH 05/10] feat: group for control sequence to scope highlighting of types and module --- rc/filetype/latex.kak | 61 ++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index bfa70f39..46bdf046 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -33,37 +33,44 @@ provide-module latex %~ add-highlighter shared/latex regions add-highlighter shared/latex/content default-region group +# Region for control sequence (with latex2e arguments and options) starting with unescaped \ +# and ending at eol or word boundaries not preceded nor followed by @ : \ { } [ ] * +add-highlighter shared/latex/cs region '(? Date: Sun, 26 Jun 2022 21:55:01 +0200 Subject: [PATCH 06/10] fix: proper escaping for math mode --- rc/filetype/latex.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index 46bdf046..3c110ce7 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -70,7 +70,7 @@ add-highlighter shared/latex/content/ regex '(? Date: Mon, 27 Jun 2022 08:55:09 +0200 Subject: [PATCH 07/10] fix: add . to include number and fp in lists --- rc/filetype/latex.kak | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index 3c110ce7..1d9f354a 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -38,9 +38,9 @@ add-highlighter shared/latex/content default-region group add-highlighter shared/latex/cs region '(? Date: Tue, 28 Jun 2022 17:04:35 +0200 Subject: [PATCH 08/10] fix: alternate stop cs region after first non escaped } to prevent gobbling % --- rc/filetype/latex.kak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index 1d9f354a..fa75b497 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -33,9 +33,9 @@ provide-module latex %~ add-highlighter shared/latex regions add-highlighter shared/latex/content default-region group -# Region for control sequence (with latex2e arguments and options) starting with unescaped \ +# Region for control sequence (includes latex2e arguments and options) starting with unescaped \ # and ending at eol or word boundaries not preceded nor followed by @ : \ { } [ ] * -add-highlighter shared/latex/cs region '(? Date: Thu, 30 Jun 2022 14:00:45 +0200 Subject: [PATCH 09/10] feat: add .ins (latex package installation) file extension to latex type as it is not linked to other filetype --- rc/filetype/latex.kak | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index fa75b497..3a775311 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -33,8 +33,11 @@ provide-module latex %~ add-highlighter shared/latex regions add-highlighter shared/latex/content default-region group -# Region for control sequence (includes latex2e arguments and options) starting with unescaped \ -# and ending at eol or word boundaries not preceded nor followed by @ : \ { } [ ] * +# Region for control sequence (includes latex2e arguments and options) +# starting with unescaped \ and ending : +# - at eol, or +# - at word boundaries not preceded nor followed by @ : \ { } [ ] *, or +# - after an unescaped } add-highlighter shared/latex/cs region '(?