From 8da2e2a7a819fe2d1d8627f0e08185866e1e3fc7 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Thu, 10 Mar 2016 15:48:12 +0200 Subject: [PATCH] Restore the `filter_around_selections` functions to balance indentation copies --- rc/base/ruby.kak | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rc/base/ruby.kak b/rc/base/ruby.kak index ee9174ef..6b8b46f1 100644 --- a/rc/base/ruby.kak +++ b/rc/base/ruby.kak @@ -61,6 +61,14 @@ addhl -group /ruby/code regex \<(alias|and|begin|break|case|class|def|defined|do # Commands # ‾‾‾‾‾‾‾‾ +def -hidden _ruby_filter_around_selections %{ + eval -draft -itersel %{ + exec + # remove trailing white spaces + try %{ exec -draft s \h + $ d } + } +} + def -hidden _ruby_indent_on_char %{ eval -draft -itersel %{ # align middle and end structures to start @@ -75,6 +83,8 @@ def -hidden _ruby_indent_on_new_line %{ eval -draft -itersel %{ # preserve previous line indent try %{ exec -draft K } + # filter previous line + try %{ exec -draft k : _ruby_filter_around_selections } # indent after start structure try %{ exec -draft k x ^ \h * (begin|case|class|def|do|else|elsif|ensure|for|if|module|rescue|unless|until|when|while) \b j } }