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 %< evaluate-commands -draft -itersel %<
# copy // comments prefix and following white spaces # copy // comments prefix and following white spaces
try %{ 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 %` } catch %`
# preserve previous line indent # preserve previous line indent
try %{ execute-keys -draft <semicolon> K <a-&> } try %{ execute-keys -draft <semicolon> K <a-&> }

View File

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

View File

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

View File

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

View File

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