Rust take indentation before comment to next line
This commit is contained in:
parent
7c791f130c
commit
dd3257e3f2
|
@ -75,7 +75,7 @@ define-command -hidden rust-indent-on-new-line %~
|
|||
evaluate-commands -draft -itersel %<
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{
|
||||
execute-keys -draft k <a-x> s ^\h*\K//[!/]?\h* <ret> y gh j P
|
||||
execute-keys -draft k <a-x> s ^\h*//[!/]?\h* <ret> y gh j P
|
||||
} catch %`
|
||||
# preserve previous line indent
|
||||
try %{ execute-keys -draft <semicolon> K <a-&> }
|
||||
|
|
1
test/indent/rust/comment/cmd
Normal file
1
test/indent/rust/comment/cmd
Normal file
|
@ -0,0 +1 @@
|
|||
c<ret>bar<esc>
|
8
test/indent/rust/comment/in
Normal file
8
test/indent/rust/comment/in
Normal file
|
@ -0,0 +1,8 @@
|
|||
// foo%( )
|
||||
|
||||
//! foo%( )
|
||||
|
||||
/// foo%( )
|
||||
|
||||
println!("hello world"); // foo%( )
|
||||
|
11
test/indent/rust/comment/out
Normal file
11
test/indent/rust/comment/out
Normal file
|
@ -0,0 +1,11 @@
|
|||
// foo
|
||||
// bar
|
||||
|
||||
//! foo
|
||||
//! bar
|
||||
|
||||
/// foo
|
||||
/// bar
|
||||
|
||||
println!("hello world"); // foo
|
||||
bar
|
3
test/indent/rust/comment/rc
Normal file
3
test/indent/rust/comment/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