1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-27 02:23:26 +03:00

Update deindentation rule for awk.kak, cabal.kak, go.kak

This commit is contained in:
John Isom 2020-07-29 15:06:27 -06:00
parent 428232d2fa
commit 1951f19fd8
3 changed files with 3 additions and 3 deletions

View File

@ -77,7 +77,7 @@ define-command -hidden awk-indent-on-new-line %[
# indent after line ending in opening curly brace
try %[ execute-keys -draft k<a-x> <a-k>\{\h*(#.*)?$<ret> j<a-gt> ]
# deindent closing brace when after cursor
try %[ execute-keys -draft <a-x> <a-k>^\h*\}\h*(?:#.*)?$<ret> hm <a-S> 1<a-&> ]
try %[ execute-keys -draft <a-x> <a-k> ^\h*\} <ret> gh / \} <ret> m <a-S> 1<a-&> ]
]
]

View File

@ -61,7 +61,7 @@ define-command -hidden cabal-indent-on-new-line %[
# indent after lines ending with { or :
try %[ execute-keys -draft <space> k <a-x> <a-k> [:{]$ <ret> j <a-gt> ]
# deindent closing brace when after cursor
try %[ execute-keys -draft <a-x> <a-k> \h*\} <ret> / \} <ret> m <a-S> 1<a-&> ]
try %[ execute-keys -draft <a-x> <a-k> \h*\} <ret> gh / \} <ret> m <a-S> 1<a-&> ]
]
]

View File

@ -90,7 +90,7 @@ define-command -hidden go-indent-on-new-line %~
# indent after if|else|while|for
try %[ execute-keys -draft <semicolon><a-F>)MB <a-k> \A(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\z <ret> s \A|.\z <ret> 1<a-&>1<a-space><a-gt> ]
# deindent closing brace(s) when after cursor
try %[ execute-keys -draft <a-x> <a-k>^\h*[})]+\h*$<ret> hm <a-S> 1<a-&> ]
try %[ execute-keys -draft <a-x> <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> ]
=
~