summaryrefslogtreecommitdiff
path: root/rc/filetype/json.kak
diff options
context:
space:
mode:
authorJohn Isom <John.Isom2001@gmail.com>2020-07-27 20:52:35 -0600
committerJohn Isom <John.Isom2001@gmail.com>2020-07-27 20:52:35 -0600
commit9dd292d100bf266e391fa9ef3314e2c6a4a447f6 (patch)
tree083f489b5e91df1e046107ad599b33a288983093 /rc/filetype/json.kak
parent8c9afa8a91900dcb0dd42d293e0bcd0ca4491b53 (diff)
Fix indentation rule for json.kak
Diffstat (limited to 'rc/filetype/json.kak')
-rw-r--r--rc/filetype/json.kak2
1 files changed, 2 insertions, 0 deletions
diff --git a/rc/filetype/json.kak b/rc/filetype/json.kak
index d5a0b8c5..58f1e328 100644
--- a/rc/filetype/json.kak
+++ b/rc/filetype/json.kak
@@ -61,6 +61,8 @@ define-command -hidden json-indent-on-new-line %<
try %{ execute-keys -draft k : json-trim-indent <ret> }
# indent after lines beginning with opener token
try %< execute-keys -draft k <a-x> <a-k> ^\h*[[{] <ret> j <a-gt> >
+ # deindent opener token(s) when after cursor
+ try %< execute-keys -draft <a-x> <a-k>^\h*[}\]]+\h*$<ret> hm <a-S> 1<a-&> >
>
>