From f9351d65eb05d4c388ac90560723c5a231998f7d Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Sat, 4 Nov 2017 21:54:48 +1100 Subject: [PATCH] rust.kak: Support Rust's documentation comments. As well as ordinary `//` line-comments, Rust regards `///` comments as documentation applying to the following item, and `//!` comments as documentation applying to the enclosing item, so we should copy those to new lines, too. --- rc/base/rust.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/base/rust.kak b/rc/base/rust.kak index d5e7ded0..9909cb8e 100644 --- a/rc/base/rust.kak +++ b/rc/base/rust.kak @@ -42,7 +42,7 @@ define-command -hidden rust-filter-around-selections %{ 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*\K//\h* y gh j P } + try %{ execute-keys -draft k s ^\h*\K//[!/]?\h* y gh j P } # preserve previous line indent try %{ execute-keys -draft \; K } # filter previous line