From 322d0659fd1882582fae4f1e13c628ace32ae0c1 Mon Sep 17 00:00:00 2001 From: John Isom Date: Sat, 1 Aug 2020 11:54:57 -0600 Subject: [PATCH] Add 'when' to list of keywords that signifies end for `ruby-insert-on-new-line` --- rc/filetype/ruby.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/ruby.kak b/rc/filetype/ruby.kak index e5a2f7117..272dcf09a 100644 --- a/rc/filetype/ruby.kak +++ b/rc/filetype/ruby.kak @@ -169,7 +169,7 @@ define-command -hidden ruby-insert-on-new-line %[ # Check if previous line opens a block execute-keys -draft k ^x(begin|case|class|def|for|if|module|unless|until|while|.+\bdo$|.+\bdo\h\|.+(?=\|))[^0-9A-Za-z_!?] # Check that we do not already have an end for this indent level which is first set via `ruby-indent-on-new-line` hook - execute-keys -draft }i J ^x(end|else|elsif|rescue)[^0-9A-Za-z_!?] + execute-keys -draft }i J ^x(end|else|elsif|rescue|when)[^0-9A-Za-z_!?] ] execute-keys -draft oxend # insert a new line with containing end ]