From cd656ae4ebc44f9e8f3aea85f9e5dec4cc9b45b3 Mon Sep 17 00:00:00 2001 From: Alex Leferry 2 Date: Wed, 16 Jul 2014 13:56:40 +0200 Subject: [PATCH] javascript.kak: fix indent on closer token --- rc/javascript.kak | 8 ++++---- rc/json.kak | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rc/javascript.kak b/rc/javascript.kak index 4592d4db..6ace8dad 100644 --- a/rc/javascript.kak +++ b/rc/javascript.kak @@ -47,10 +47,10 @@ def -hidden _javascript_filter_around_selections %{ } def -hidden _javascript_indent_on_char " - eval -draft -itersel ' - # indent closer token to its opener - try %_ exec -draft gh ^\h*[]}] m _ - ' + eval -draft -itersel %_ + # align closer token to its opener when alone on a line + try %/ exec -draft ^\h+[]}]$ m s \`|.\' 1 / + _ " def -hidden _javascript_indent_on_new_line " diff --git a/rc/json.kak b/rc/json.kak index f1a32f3b..dcc18db3 100644 --- a/rc/json.kak +++ b/rc/json.kak @@ -34,10 +34,10 @@ def -hidden _json_filter_around_selections %{ } def -hidden _json_indent_on_char " - eval -draft -itersel ' - # indent closer token to its opener - try %_ exec -draft gh ^\h*[]}] m _ - ' + eval -draft -itersel %_ + # align closer token to its opener when alone on a line + try %/ exec -draft ^\h+[]}]$ m s \`|.\' 1 / + _ " def -hidden _json_indent_on_new_line "