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.
This commit is contained in:
Tim Allen 2017-11-04 21:54:48 +11:00
parent 9b216e0e79
commit f9351d65eb

View File

@ -42,7 +42,7 @@ define-command -hidden rust-filter-around-selections %{
define-command -hidden rust-indent-on-new-line %~ 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 %{ execute-keys -draft k <a-x> s ^\h*\K//\h* <ret> y gh j P } try %{ execute-keys -draft k <a-x> s ^\h*\K//[!/]?\h* <ret> y gh j P }
# preserve previous line indent # preserve previous line indent
try %{ execute-keys -draft \; K <a-&> } try %{ execute-keys -draft \; K <a-&> }
# filter previous line # filter previous line