summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Isom <John.Isom2001@gmail.com>2020-08-01 10:35:34 -0600
committerJohn Isom <John.Isom2001@gmail.com>2020-08-01 10:35:34 -0600
commit145f2db741d805a17efcbb71e68e153bb20641ad (patch)
tree292ad4834687b06b0e38d26926c401b18cba1cab
parent0fe71ebadaceadd7bda20bb69760a040cadae331 (diff)
Add rule to align 'end' with opening statement
-rw-r--r--rc/filetype/crystal.kak2
1 files changed, 2 insertions, 0 deletions
diff --git a/rc/filetype/crystal.kak b/rc/filetype/crystal.kak
index 9808cddd..30a16e93 100644
--- a/rc/filetype/crystal.kak
+++ b/rc/filetype/crystal.kak
@@ -208,6 +208,8 @@ define-command -hidden crystal-indent-on-char %{
try %{ execute-keys -draft <a-x> <a-k> ^\h*(?:when)$ <ret> <a-semicolon> <a-?> ^\h*(?:case) <ret> <a-S> 1<a-&> }
# align 'rescue' to 'begin/def'
try %{ execute-keys -draft <a-x> <a-k> ^\h*(?:rescue)$ <ret> <a-semicolon> <a-?> ^\h*(?:begin|def) <ret> <a-S> 1<a-&> }
+ # align 'end' to opening structure
+ try %{ execute-keys -draft <a-x> <a-k> ^\h*(?:end)$ <ret> <a-semicolon> <a-?> ^\h*(?:begin|case|class|def|for|if|module|unless|until|while) <ret> <a-S> 1<a-&> }
}
}