Add rust test for empty line indent
This commit is contained in:
parent
5c8dfcdfa9
commit
785cbaeaed
|
@ -151,7 +151,7 @@ define-command -hidden rust-indent-on-new-line %~
|
||||||
# indent after lines ending with [{(].+ and move first parameter to own line
|
# 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-&> >
|
try %< execute-keys -draft [c[({],[)}] <ret> <a-k> \A[({][^\n]+\n[^\n]*\n?\z <ret> L i<ret><esc> <gt> <a-S> <a-&> >
|
||||||
# indent after non-empty lines not starting with operator and not ending with , or ;
|
# indent after non-empty lines not starting with operator and not ending with , or ;
|
||||||
# XXX s [^\h]* is workaround for broken negate match #3766, use this later
|
# XXX simplify this into a single <a-k> without s
|
||||||
try %< execute-keys -draft k <a-x> s [^\h].+ <ret> <a-K> \A[-+*/&|^})<gt><lt>] <ret> <a-K> [,<semicolon>](\h*/[/*].*|)$ <ret> j <a-gt> >
|
try %< execute-keys -draft k <a-x> s [^\h].+ <ret> <a-K> \A[-+*/&|^})<gt><lt>] <ret> <a-K> [,<semicolon>](\h*/[/*].*|)$ <ret> j <a-gt> >
|
||||||
# dedent after lines starting with . and ending with } or ) or , or ;
|
# dedent after lines starting with . and ending with } or ) or , 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> _
|
||||||
|
|
1
test/indent/rust/empty-line/cmd
Normal file
1
test/indent/rust/empty-line/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
c<ret>bar<esc>
|
2
test/indent/rust/empty-line/in
Normal file
2
test/indent/rust/empty-line/in
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
%( )
|
||||||
|
|
3
test/indent/rust/empty-line/out
Normal file
3
test/indent/rust/empty-line/out
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
bar
|
||||||
|
|
3
test/indent/rust/empty-line/rc
Normal file
3
test/indent/rust/empty-line/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