Update rust brace deindenting to handle bad indentation edge case

This commit is contained in:
John Isom 2020-07-27 12:15:11 -06:00
parent 26f4681c3b
commit de214d262c

View File

@ -113,7 +113,7 @@ define-command -hidden rust-indent-on-new-line %~
# dedent after lines starting with . and ending with , or ; # dedent after lines starting with . and ending with , or ;
try %_ execute-keys -draft k <a-x> <a-k> ^\h*\..*[,<semicolon>]\h*$ <ret> j <a-lt> _ try %_ execute-keys -draft k <a-x> <a-k> ^\h*\..*[,<semicolon>]\h*$ <ret> j <a-lt> _
# deindent closing brace(s) when after cursor # deindent closing brace(s) when after cursor
try %< execute-keys -draft <a-x> <a-k>^\h*[})]+\h*$<ret> <a-lt> > try %< execute-keys -draft <a-x> <a-k>^\h*[})]+\h*$<ret> hm <a-S> 1<a-&> >
# todo dedent additional unmatched parenthesis # todo dedent additional unmatched parenthesis
# try %& execute-keys -draft k <a-x> s \((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*\) l Gl s\) %sh{ # try %& execute-keys -draft k <a-x> s \((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*\) l Gl s\) %sh{
# count previous selections length # count previous selections length