From 507f799ce499006948509066e5750c3a82e496df Mon Sep 17 00:00:00 2001 From: John Isom Date: Tue, 28 Jul 2020 20:52:06 -0600 Subject: [PATCH 1/2] Fix already-existing bug in perl.kak --- rc/filetype/perl.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/perl.kak b/rc/filetype/perl.kak index d3f03ed2..d94f27d4 100644 --- a/rc/filetype/perl.kak +++ b/rc/filetype/perl.kak @@ -111,8 +111,8 @@ define-command -hidden perl-indent-on-new-line %~ try %{ execute-keys -draft k s \h+$ d } # align to opening paren of previous line try %{ execute-keys -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } - # copy // comments prefix - try %{ execute-keys -draft k s ^\h*\K/{2,} yP } + # copy # comments prefix + try %{ execute-keys -draft k s ^\h*\K# yP } # indent after a switch's case/default statements try %[ execute-keys -draft k ^\h*(case|default).*:$ j ] # indent after if|else|while|for From ba8fca741c3d021c9bc4f117b0c9536992a5c1b8 Mon Sep 17 00:00:00 2001 From: John Isom Date: Wed, 29 Jul 2020 08:52:04 -0600 Subject: [PATCH 2/2] Update deindenting in kakrc.kak --- rc/filetype/kakrc.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/kakrc.kak b/rc/filetype/kakrc.kak index 024e1076..4bf2966e 100644 --- a/rc/filetype/kakrc.kak +++ b/rc/filetype/kakrc.kak @@ -101,9 +101,9 @@ define-command -hidden kak-indent-on-new-line %~ # indent after line ending with %\w*[^\s\w] try %{ execute-keys -draft k \%\w*[^\s\w]$ j } # deindent closing brace when after cursor - try %_ execute-keys -draft ^\h*[>)}\]]\h*$ hm 1 _ + try %_ execute-keys -draft -itersel ^\h*([>)}\]])\h*(?:\h#.*)?$ 1 m 1 _ # deindent closing char(s) - try %{ execute-keys -draft -itersel ^\h*([^\s\w])\h*$ h 1 % \w*1$ 1 } + try %{ execute-keys -draft -itersel ^\h*([^\s\w])\h*(?:\h#.*)?$ 1 1 % \w*1$ 1 } = ~