diff --git a/rc/filetype/ruby.kak b/rc/filetype/ruby.kak index 43c3d2fd..4f6cc631 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\|.+(?=\|))\b # 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 ^xend$ + execute-keys -draft }i J ^x(end|else|elsif|rescue)\b ] execute-keys -draft oxend # insert a new line with containing end ]