summaryrefslogtreecommitdiff
path: root/rc/javascript.kak
diff options
context:
space:
mode:
authorAlex Leferry 2 <alexherbo2@gmail.com>2014-07-16 13:56:40 +0200
committerAlex Leferry 2 <alexherbo2@gmail.com>2014-07-16 13:56:40 +0200
commitcd656ae4ebc44f9e8f3aea85f9e5dec4cc9b45b3 (patch)
treef14ea7eef86531f4ce2b8f3635b36501708d5566 /rc/javascript.kak
parente6699c66ede2d482fe2a6d16c3367913c5116dad (diff)
javascript.kak: fix indent on closer token
Diffstat (limited to 'rc/javascript.kak')
-rw-r--r--rc/javascript.kak8
1 files changed, 4 insertions, 4 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 <a-k> ^\h*[]}] <ret> m <a-&> _
- '
+ eval -draft -itersel %_
+ # align closer token to its opener when alone on a line
+ try %/ exec -draft <a-h> <a-k> ^\h+[]}]$ <ret> m s \`|.\' <ret> 1<a-&> /
+ _
"
def -hidden _javascript_indent_on_new_line "