From 0fe71ebadaceadd7bda20bb69760a040cadae331 Mon Sep 17 00:00:00 2001 From: John Isom Date: Sat, 1 Aug 2020 10:33:35 -0600 Subject: [PATCH] Add deindentation rule for 'rescue' statement --- rc/filetype/crystal.kak | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc/filetype/crystal.kak b/rc/filetype/crystal.kak index 961830545..9808cddde 100644 --- a/rc/filetype/crystal.kak +++ b/rc/filetype/crystal.kak @@ -206,13 +206,15 @@ define-command -hidden crystal-indent-on-char %{ try %{ execute-keys -draft ^\h*(?:else|elsif)$ ^\h*(?:if) 1 } # align 'when' to 'case' try %{ execute-keys -draft ^\h*(?:when)$ ^\h*(?:case) 1 } + # align 'rescue' to 'begin/def' + try %{ execute-keys -draft ^\h*(?:rescue)$ ^\h*(?:begin|def) 1 } } } define-command -hidden crystal-fetch-keywords %{ set-register dquote %sh{ curl --location https://github.com/crystal-lang/crystal/raw/master/src/compiler/crystal/syntax/lexer.cr | - kak -f '%1scheck_ident_or_keyword\(:(\w+\??), \w+\)y%aa|sort' + kak -f '%1scheck_ident_or_keyword\(:(\w+\??), \w+\)y%aa|sort' } }