on master help sign in
Making the 'set-option' command help more descriptive. (#2365)

* Making the 'set-option' command help more descriptive. * Adding the generated docs * Making the message multi-line * Replace newline with break in generated docs

commit09a17e4fa3d0aa67e399c02c484a768d85acaac6 authorBen Lee-Cohen <ben@bencohen.net> dateTue 3 May 2022, 22:17 (4 years ago) parentf59b3b9
3 files changed+5−3
book/src/generated/typable-cmd.md+1−1 helix-term/src/commands/typed.rs+1−1 xtask/src/main.rs+3−1
book/src/generated/typable-cmd.md+1−1
@@ -55,7 +55,7 @@
5555| `:tutor` | Open the tutorial. |
5656| `:goto`, `:g` | Go to line number. |
5757| `:set-language`, `:lang` | Set the language of current buffer. |
58−| `:set-option`, `:set` | Set a config option at runtime. |
58+| `:set-option`, `:set` | Set a config option at runtime.<br>For example to disable smart case search, use `:set search.smart-case false`. |
5959| `:get-option`, `:get` | Get the current value of a config option. |
6060| `:sort` | Sort ranges in selection. |
6161| `:rsort` | Sort ranges in selection in reverse order. |
helix-term/src/commands/typed.rs+1−1
@@ -1594,7 +1594,7 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
15941594 TypableCommand {
15951595 name: "set-option",
15961596 aliases: &["set"],
1597− doc: "Set a config option at runtime.",
1597+ doc: "Set a config option at runtime.\nFor example to disable smart case search, use `:set search.smart-case false`.",
15981598 fun: set_option,
15991599 completer: Some(completers::setting),
16001600 },
xtask/src/main.rs+3−1
@@ -106,7 +106,9 @@ pub mod md_gen {
106106 .collect::<Vec<_>>()
107107 .join(", ");
108108
109− md.push_str(&md_table_row(&[names.to_owned(), cmd.doc.to_owned()]));
109+ let doc = cmd.doc.replace("\n", "<br>");
110+
111+ md.push_str(&md_table_row(&[names.to_owned(), doc.to_owned()]));
110112 }
111113
112114 Ok(md)