diff --git a/rc/filetype/d.kak b/rc/filetype/d.kak index 8bf40e26..73db7e52 100644 --- a/rc/filetype/d.kak +++ b/rc/filetype/d.kak @@ -122,7 +122,7 @@ define-command -hidden d-indent-on-new-line %~ # indent after if|else|while|for try %[ execute-keys -draft )MB \A(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\z s \A|.\z 11 ] # deindent closing brace(s) when after cursor - try %[ execute-keys -draft ^\h*[})]+\h*\;?\h*(?://.*)?$ \; [})] m 1 ] + try %[ execute-keys -draft ^\h*[})] gh / [})] m 1 ] = ~ diff --git a/rc/filetype/json.kak b/rc/filetype/json.kak index 76b4e861..67f0506c 100644 --- a/rc/filetype/json.kak +++ b/rc/filetype/json.kak @@ -62,7 +62,7 @@ define-command -hidden json-indent-on-new-line %< # indent after lines ending with opener token try %< execute-keys -draft k [[{]\h*$ j > # deindent closer token(s) when after cursor - try %< execute-keys -draft ^\h*[}\]]+ \; gh / [}\]] m 1 > + try %< execute-keys -draft ^\h*[}\]] gh / [}\]] m 1 > > > diff --git a/rc/filetype/kakrc.kak b/rc/filetype/kakrc.kak index 4bf2966e..bf59cdbf 100644 --- a/rc/filetype/kakrc.kak +++ b/rc/filetype/kakrc.kak @@ -101,9 +101,9 @@ define-command -hidden kak-indent-on-new-line %~ # indent after line ending with %\w*[^\s\w] try %{ execute-keys -draft k \%\w*[^\s\w]$ j } # deindent closing brace when after cursor - try %_ execute-keys -draft -itersel ^\h*([>)}\]])\h*(?:\h#.*)?$ 1 m 1 _ + try %_ execute-keys -draft -itersel ^\h*([>)}\]]) gh / 1 m 1 _ # deindent closing char(s) - try %{ execute-keys -draft -itersel ^\h*([^\s\w])\h*(?:\h#.*)?$ 1 1 % \w*1$ 1 } + try %{ execute-keys -draft -itersel ^\h*([^\s\w]) gh / 1 1 % \w*1$ 1 } = ~ diff --git a/rc/filetype/latex.kak b/rc/filetype/latex.kak index 38bf7882..a872ad14 100644 --- a/rc/filetype/latex.kak +++ b/rc/filetype/latex.kak @@ -69,7 +69,7 @@ define-command -hidden latex-indent-newline %( # indent after line ending with { try %( execute-keys -draft k \{$ j ) # deindent closing brace(s) when after cursor - try %( execute-keys -draft ^\h*\}+\h*(?:%.*)?$ \} m 1 ) + try %( execute-keys -draft ^\h*\} gh / \} m 1 ) # indent after line ending with \begin{...}[...]{...}, with multiple # sets of arguments possible try %( diff --git a/rc/filetype/perl.kak b/rc/filetype/perl.kak index 9fa14bb8..348b4cd3 100644 --- a/rc/filetype/perl.kak +++ b/rc/filetype/perl.kak @@ -118,7 +118,7 @@ define-command -hidden perl-indent-on-new-line %~ # indent after if|else|while|for try %[ execute-keys -draft )MB \A(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\z s \A|.\z 11 ] # deindent closing brace(s) when after cursor - try %[ execute-keys -draft ^\h*[})]+\h*(?:#.*)?$ \; [})] m 1 ] + try %[ execute-keys -draft ^\h*[})] gh / [})] m 1 ] = ~ diff --git a/rc/filetype/php.kak b/rc/filetype/php.kak index 075b0eb8..770a4b60 100644 --- a/rc/filetype/php.kak +++ b/rc/filetype/php.kak @@ -94,7 +94,7 @@ define-command -hidden php-indent-on-new-line %< # append " * " on lines starting a multiline /** or /* comment try %{ execute-keys -draft k s ^\h*/[*][* ]? j gi i * } # deindent closer token(s) when after cursor - try %_ execute-keys -draft ^\h*[})]+\h*(?://.*)?$ \; [})] m 1 _ + try %_ execute-keys -draft ^\h*[})] gh / [})] m 1 _ > > diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 92d5cfa8..049fc444 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -113,7 +113,7 @@ define-command -hidden rust-indent-on-new-line %~ # dedent after lines starting with . and ending with , or ; try %_ execute-keys -draft k ^\h*\..*[,]\h*$ j _ # deindent closing brace(s) when after cursor - try %= execute-keys -draft ^\h*[})]+\h*$ \; [})] m 1 = + try %= execute-keys -draft ^\h*[})] gh / [})] m 1 = # todo dedent additional unmatched parenthesis # try %& execute-keys -draft k s \((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*\) l Gl s\) %sh{ # count previous selections length