From d4d19c25908bd373b0af42ab6ec1cb458a126404 Mon Sep 17 00:00:00 2001 From: Alex Leferry 2 Date: Wed, 3 Feb 2016 09:05:58 +0100 Subject: [PATCH] clean up --- rc/coffee.kak | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rc/coffee.kak b/rc/coffee.kak index b7732592..3d1020e0 100644 --- a/rc/coffee.kak +++ b/rc/coffee.kak @@ -50,8 +50,11 @@ addhl -group /coffee/code regex \<(break|case|catch|class|const|continue|debugge # ‾‾‾‾‾‾‾‾ def -hidden _coffee_filter_around_selections %{ - # remove trailing white spaces - try %{ exec -draft -itersel s \h+$ d } + eval -draft -itersel %{ + exec + # remove trailing white spaces + try %{ exec -draft s \h + $ d } + } } def -hidden _coffee_indent_on_new_line %{ @@ -61,9 +64,9 @@ def -hidden _coffee_indent_on_new_line %{ # filter previous line try %{ exec -draft k : _coffee_filter_around_selections } # copy '#' comment prefix and following white spaces - try %{ exec -draft k x s ^\h*\K#\h* y j p } - # indent after lines beginning with token and ending with -> - try %_ exec -draft k x ^\h*(case|catch|class|else|finally|for|function|if|switch|try|while|with)|(->)$ j _ + try %{ exec -draft k x s ^ \h * \K \# \h * y j p } + # indent after start structure + try %{ exec -draft k x ^ \h * (case|catch|class|else|finally|for|function|if|switch|try|while|with) | (->) $ j } } }