diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 35788fd8..5dca28a2 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -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 s ^\h*//[!/]?\h* y gh j P + execute-keys -draft k s ^\h*//[!/]{0,2}\h* y gh j P } catch %` # preserve previous line indent try %{ execute-keys -draft K } diff --git a/test/indent/rust/comment/in b/test/indent/rust/comment/in index bb887d68..d546e66a 100644 --- a/test/indent/rust/comment/in +++ b/test/indent/rust/comment/in @@ -2,7 +2,11 @@ //! foo%( ) + //!! foo%( ) + /// foo%( ) + //// foo%( ) + println!("hello world"); // foo%( ) diff --git a/test/indent/rust/comment/out b/test/indent/rust/comment/out index 813ec7f2..6b57b5ef 100644 --- a/test/indent/rust/comment/out +++ b/test/indent/rust/comment/out @@ -4,8 +4,15 @@ //! foo //! bar + //!! foo + //!! bar + /// foo /// bar + //// foo + //// bar + println!("hello world"); // foo bar + diff --git a/test/indent/rust/dedent/in b/test/indent/rust/dedent/in index 85e605c1..21c5f6ef 100644 --- a/test/indent/rust/dedent/in +++ b/test/indent/rust/dedent/in @@ -10,3 +10,7 @@ foo() .bar() .baz();%( ) + + let t = "a + wah";%( ) + diff --git a/test/indent/rust/dedent/out b/test/indent/rust/dedent/out index f4bc0a07..cea4d1d3 100644 --- a/test/indent/rust/dedent/out +++ b/test/indent/rust/dedent/out @@ -14,3 +14,8 @@ .bar() .baz(); bar + + let t = "a + wah"; + bar +