From 090c0b4db12138a8f1b1237ff2fa03e0c8bb99e7 Mon Sep 17 00:00:00 2001 From: codesoap Date: Mon, 22 Jul 2019 17:32:25 +0200 Subject: [PATCH 1/4] Allow / in target when highlighting in makefile.kak --- rc/filetype/makefile.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/makefile.kak b/rc/filetype/makefile.kak index 7f7ebbe5..c2e04588 100644 --- a/rc/filetype/makefile.kak +++ b/rc/filetype/makefile.kak @@ -33,7 +33,7 @@ add-highlighter shared/makefile/content default-region group add-highlighter shared/makefile/comment region '#' '$' fill comment add-highlighter shared/makefile/evaluate-commands region -recurse '\(' '\$\(' '\)' fill value -add-highlighter shared/makefile/content/ regex ^[\w.%-]+\h*:\s 0:variable +add-highlighter shared/makefile/content/ regex ^[\w.%-/]+\h*:\s 0:variable add-highlighter shared/makefile/content/ regex [+?:]= 0:operator evaluate-commands %sh{ From 4c3795faa2751c99c805ac0eaee1c00a2931ae24 Mon Sep 17 00:00:00 2001 From: codesoap Date: Tue, 30 Jul 2019 09:55:25 +0200 Subject: [PATCH 2/4] makefile.kak: Refine regex for target Multiple targets and the target separators ':', '::' and '!' are now supported. --- rc/filetype/makefile.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/makefile.kak b/rc/filetype/makefile.kak index c2e04588..fcc51ac8 100644 --- a/rc/filetype/makefile.kak +++ b/rc/filetype/makefile.kak @@ -33,7 +33,7 @@ add-highlighter shared/makefile/content default-region group add-highlighter shared/makefile/comment region '#' '$' fill comment add-highlighter shared/makefile/evaluate-commands region -recurse '\(' '\$\(' '\)' fill value -add-highlighter shared/makefile/content/ regex ^[\w.%-/]+\h*:\s 0:variable +add-highlighter shared/makefile/content/ regex ^\S.*?(::|:|!) 0:variable add-highlighter shared/makefile/content/ regex [+?:]= 0:operator evaluate-commands %sh{ @@ -55,7 +55,7 @@ define-command -hidden makefile-indent-on-new-line %{ # preserve previous line indent try %{ execute-keys -draft \;K } ## If the line above is a target indent with a tab - try %{ execute-keys -draft Z k ^[^:]+:\s z i } + try %{ execute-keys -draft Z k ^[^\t].*?(::|:|!) z i } # cleanup trailing white space son previous line try %{ execute-keys -draft k s \h+$ d } # indent after some keywords From 6e86766966fc641e6788cf6f1568009bd4272e1a Mon Sep 17 00:00:00 2001 From: codesoap Date: Tue, 30 Jul 2019 10:00:04 +0200 Subject: [PATCH 3/4] makefile.kak: remove reqex mismatch between highlight and indent --- rc/filetype/makefile.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/makefile.kak b/rc/filetype/makefile.kak index fcc51ac8..452f6446 100644 --- a/rc/filetype/makefile.kak +++ b/rc/filetype/makefile.kak @@ -55,7 +55,7 @@ define-command -hidden makefile-indent-on-new-line %{ # preserve previous line indent try %{ execute-keys -draft \;K } ## If the line above is a target indent with a tab - try %{ execute-keys -draft Z k ^[^\t].*?(::|:|!) z i } + try %{ execute-keys -draft Z k ^\S.*?(::|:|!) z i } # cleanup trailing white space son previous line try %{ execute-keys -draft k s \h+$ d } # indent after some keywords From e502097d01ac38000a0bf7fe3076c4f8d66c7911 Mon Sep 17 00:00:00 2001 From: codesoap Date: Tue, 30 Jul 2019 14:43:11 +0200 Subject: [PATCH 4/4] makefile.kak: require whitespace after target --- rc/filetype/makefile.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/makefile.kak b/rc/filetype/makefile.kak index 452f6446..26f4f564 100644 --- a/rc/filetype/makefile.kak +++ b/rc/filetype/makefile.kak @@ -33,7 +33,7 @@ add-highlighter shared/makefile/content default-region group add-highlighter shared/makefile/comment region '#' '$' fill comment add-highlighter shared/makefile/evaluate-commands region -recurse '\(' '\$\(' '\)' fill value -add-highlighter shared/makefile/content/ regex ^\S.*?(::|:|!) 0:variable +add-highlighter shared/makefile/content/ regex ^\S.*?(::|:|!)\s 0:variable add-highlighter shared/makefile/content/ regex [+?:]= 0:operator evaluate-commands %sh{ @@ -55,7 +55,7 @@ define-command -hidden makefile-indent-on-new-line %{ # preserve previous line indent try %{ execute-keys -draft \;K } ## If the line above is a target indent with a tab - try %{ execute-keys -draft Z k ^\S.*?(::|:|!) z i } + try %{ execute-keys -draft Z k ^\S.*?(::|:|!)\s z i } # cleanup trailing white space son previous line try %{ execute-keys -draft k s \h+$ d } # indent after some keywords