Fix indentation for closing braces in kakrc.kak

This fixes %{ }, %< > style, not %| |, %= =, etc
This commit is contained in:
John Isom 2020-07-27 21:21:33 -06:00
parent fd3716a12b
commit d818ff8ac0

View File

@ -90,8 +90,8 @@ add-highlighter shared/kakrc/single_string/escape regex "''" 0:default+b
# Commands # Commands
# ‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾
define-command -hidden kak-indent-on-new-line %{ define-command -hidden kak-indent-on-new-line %~
evaluate-commands -draft -itersel %{ evaluate-commands -draft -itersel %=
# copy '#' comment prefix and following white spaces # copy '#' comment prefix and following white spaces
try %{ execute-keys -draft k <a-x> s ^\h*#\h* <ret> y jgh P } try %{ execute-keys -draft k <a-x> s ^\h*#\h* <ret> y jgh P }
# preserve previous line indent # preserve previous line indent
@ -100,8 +100,10 @@ define-command -hidden kak-indent-on-new-line %{
try %{ execute-keys -draft k <a-x> s \h+$ <ret> d } try %{ execute-keys -draft k <a-x> s \h+$ <ret> d }
# indent after line ending with %\w*[^\s\w] # indent after line ending with %\w*[^\s\w]
try %{ execute-keys -draft k <a-x> <a-k> \%\w*[^\s\w]$ <ret> j <a-gt> } try %{ execute-keys -draft k <a-x> <a-k> \%\w*[^\s\w]$ <ret> j <a-gt> }
} # deindent closing brace when after cursor
} try %_ execute-keys -draft -itersel <a-x> <a-k>^\h*[>)}\]]\h*$<ret> hm <a-S> 1<a-&> _
=
~
define-command -hidden kak-indent-on-closing-matching %~ define-command -hidden kak-indent-on-closing-matching %~
# align to opening matching brace when alone on a line # align to opening matching brace when alone on a line