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 "