diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index b1024424..d4b9826c 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -147,7 +147,7 @@ define-command -hidden rust-indent-on-new-line %~ ] } catch %` # re-indent previous line if it starts with where to match previous block - try %+ execute-keys -draft k ^\h*where\b hh impl|fn|struct|enum|union 1 + + try %+ execute-keys -draft k ^\h*where\b hh ^\h*\b(impl|fn|struct|enum|union)\b 1 + # preserve previous line indent try %{ execute-keys -draft K } # indent after lines ending with [{(].+ and move first parameter to own line @@ -175,7 +175,7 @@ define-command -hidden rust-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren try %[ execute-keys -draft h ) M \A\(.*\)\h*\n\h*\{\z s \A|.\z 1 ] # dedent standalone { after impl and related block without any { in between - try %< execute-keys -draft hh impl|fn|struct|enum|union|if|for \{ ll ^\h*\{$ > + try %< execute-keys -draft hh ^\h*\b(impl|fn|struct|enum|union|if|for)\b \{ ll ^\h*\{$ > _ ]