diff --git a/rc/filetype/clojure.kak b/rc/filetype/clojure.kak index 68b79eca..9e8d73b8 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 f2052b2f..9fc49ec0 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 00000000..76003030 --- /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 00000000..c2601504 --- /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 00000000..980d3a86 --- /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 00000000..2b8f9960 --- /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 00000000..76003030 --- /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 00000000..80686386 --- /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 00000000..a2e115c9 --- /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 00000000..4338909f --- /dev/null +++ b/test/indent/lisp/doubled-brackets/rc @@ -0,0 +1,2 @@ +source "%val{runtime}/rc/filetype/lisp.kak" +set buffer filetype lisp