Rust indent after standalone where
This commit is contained in:
parent
de4b7f3864
commit
b1beea8638
|
@ -83,6 +83,8 @@ define-command -hidden rust-indent-on-new-line %~
|
|||
try %[ execute-keys -draft k <a-x> <a-k> [{(]\h*$ <ret> j <a-gt> ]
|
||||
# indent after lines ending with [{(].+ and move first parameter to own line
|
||||
try %< execute-keys -draft [c[({],[)}] <ret> <a-k> \A[({][^\n]+\n[^\n]*\n?\z <ret> L i<ret><esc> <gt> <a-S> <a-&> >
|
||||
# indent lines with a standalone where
|
||||
try %+ execute-keys -draft k <a-x> <a-k> ^\h*where\h*$ <ret> j <a-gt> +
|
||||
# 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> _
|
||||
# todo dedent additional unmatched parenthesis
|
||||
|
|
1
test/indent/rust/after-where/cmd
Normal file
1
test/indent/rust/after-where/cmd
Normal file
|
@ -0,0 +1 @@
|
|||
c<ret>bar<esc>
|
5
test/indent/rust/after-where/in
Normal file
5
test/indent/rust/after-where/in
Normal file
|
@ -0,0 +1,5 @@
|
|||
impl X for T where%( )
|
||||
|
||||
impl X for T
|
||||
where%( )
|
||||
|
7
test/indent/rust/after-where/out
Normal file
7
test/indent/rust/after-where/out
Normal file
|
@ -0,0 +1,7 @@
|
|||
impl X for T where
|
||||
bar
|
||||
|
||||
impl X for T
|
||||
where
|
||||
bar
|
||||
|
3
test/indent/rust/after-where/rc
Normal file
3
test/indent/rust/after-where/rc
Normal file
|
@ -0,0 +1,3 @@
|
|||
source "%val{runtime}/colors/default.kak"
|
||||
source "%val{runtime}/rc/filetype/rust.kak"
|
||||
set buffer filetype rust
|
Loading…
Reference in New Issue
Block a user