diff --git a/rc/filetype/clojure.kak b/rc/filetype/clojure.kak index 68b79ecaf..9e8d73b8a 100644 --- a/rc/filetype/clojure.kak +++ b/rc/filetype/clojure.kak @@ -208,7 +208,7 @@ define-command -hidden clojure-indent-on-new-line %{ execute-keys -draft '"wzes.{' %sh{printf $(( kak_opt_indentwidth - 1 ))} '}\K.*;"i' } catch %{ # If not special and parameter appears on line 1, indent to parameter - execute-keys -draft '"wze[\s()\[\]\{\}]s\h\K[^\s].*;"i' + execute-keys -draft '"wz[()[\]{}]e[\s()\[\]\{\}]s\h\K[^\s].*;"i' } } try %{ execute-keys -draft '[rl"i' } diff --git a/rc/filetype/lisp.kak b/rc/filetype/lisp.kak index f2052b2f3..9fc49ec0f 100644 --- a/rc/filetype/lisp.kak +++ b/rc/filetype/lisp.kak @@ -69,7 +69,7 @@ define-command -hidden lisp-indent-on-new-line %{ execute-keys -draft '"wzes.{' %sh{printf $(( kak_opt_indentwidth - 1 ))} '}\K.*;"i' } catch %{ # If not "special" form and parameter appears on line 1, indent to parameter - execute-keys -draft '"wzes\h\K[^\s].*;"i' + execute-keys -draft '"wz[()\[\]{}]es\h\K[^\s].*;"i' } } try %{ execute-keys -draft '[rl"i' } diff --git a/test/indent/clojure/doubled-brackets/cmd b/test/indent/clojure/doubled-brackets/cmd new file mode 100644 index 000000000..760030305 --- /dev/null +++ b/test/indent/clojure/doubled-brackets/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/clojure/doubled-brackets/in b/test/indent/clojure/doubled-brackets/in new file mode 100644 index 000000000..c26015045 --- /dev/null +++ b/test/indent/clojure/doubled-brackets/in @@ -0,0 +1,3 @@ +((metafn 42)%( )(y 79)) +([weird 42]%( )(y 79)) +({map 42}%( )(y 79)) diff --git a/test/indent/clojure/doubled-brackets/out b/test/indent/clojure/doubled-brackets/out new file mode 100644 index 000000000..980d3a861 --- /dev/null +++ b/test/indent/clojure/doubled-brackets/out @@ -0,0 +1,6 @@ +((metafn 42) + (y 79)) +([weird 42] + (y 79)) +({map 42} + (y 79)) diff --git a/test/indent/clojure/doubled-brackets/rc b/test/indent/clojure/doubled-brackets/rc new file mode 100644 index 000000000..2b8f9960c --- /dev/null +++ b/test/indent/clojure/doubled-brackets/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/rc/filetype/lisp.kak" +source "%val{runtime}/rc/filetype/clojure.kak" +set buffer filetype clojure diff --git a/test/indent/lisp/doubled-brackets/cmd b/test/indent/lisp/doubled-brackets/cmd new file mode 100644 index 000000000..760030305 --- /dev/null +++ b/test/indent/lisp/doubled-brackets/cmd @@ -0,0 +1 @@ +c diff --git a/test/indent/lisp/doubled-brackets/in b/test/indent/lisp/doubled-brackets/in new file mode 100644 index 000000000..806863860 --- /dev/null +++ b/test/indent/lisp/doubled-brackets/in @@ -0,0 +1,4 @@ +(let ((x 42)%( )(y 79))) +(let [(x 42)%( )(y 79)]) +(let ([x 42]%( )[y 79])) +(let ({x 42}%( ){y 79})) diff --git a/test/indent/lisp/doubled-brackets/out b/test/indent/lisp/doubled-brackets/out new file mode 100644 index 000000000..a2e115c9f --- /dev/null +++ b/test/indent/lisp/doubled-brackets/out @@ -0,0 +1,8 @@ +(let ((x 42) + (y 79))) +(let [(x 42) + (y 79)]) +(let ([x 42] + [y 79])) +(let ({x 42} + {y 79})) diff --git a/test/indent/lisp/doubled-brackets/rc b/test/indent/lisp/doubled-brackets/rc new file mode 100644 index 000000000..4338909f8 --- /dev/null +++ b/test/indent/lisp/doubled-brackets/rc @@ -0,0 +1,2 @@ +source "%val{runtime}/rc/filetype/lisp.kak" +set buffer filetype lisp