Rust indent block comment

This commit is contained in:
Ivan Tham 2020-05-31 11:10:11 +08:00
parent dd3257e3f2
commit de4b7f3864
5 changed files with 21 additions and 1 deletions

View File

@ -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*//[!/]?\h* <ret> y gh j P
execute-keys -draft k <a-x> s ^\h*//[!/]{0,2}\h* <ret> y gh j P
} catch %`
# preserve previous line indent
try %{ execute-keys -draft <semicolon> K <a-&> }

View File

@ -2,7 +2,11 @@
//! foo%( )
//!! foo%( )
/// foo%( )
//// foo%( )
println!("hello world"); // foo%( )

View File

@ -4,8 +4,15 @@
//! foo
//! bar
//!! foo
//!! bar
/// foo
/// bar
//// foo
//// bar
println!("hello world"); // foo
bar

View File

@ -10,3 +10,7 @@
foo()
.bar()
.baz();%( )
let t = "a
wah";%( )

View File

@ -14,3 +14,8 @@
.bar()
.baz();
bar
let t = "a
wah";
bar