aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-02-20 05:55:16 +0000
committerBlaž Hrastnik2022-02-20 05:55:16 +0000
commitc7b326be047a42f6a58146b0de049d48568e397f (patch)
tree66bde3b3af36e54ba4e75cf8f4dfed23d1d25140 /helix-term/src/commands.rs
parent2af04325d83cd0141400951252574666cffdf1af (diff)
ui: prompt: Render aliases + border on the doc
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 7e8b1d53..982ae013 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -3384,8 +3384,11 @@ fn command_mode(cx: &mut Context) {
prompt.doc_fn = Box::new(|input: &str| {
let part = input.split(' ').next().unwrap_or_default();
- if let Some(cmd::TypableCommand { doc, .. }) = cmd::TYPABLE_COMMAND_MAP.get(part) {
- return Some(doc);
+ if let Some(cmd::TypableCommand { doc, aliases, .. }) = cmd::TYPABLE_COMMAND_MAP.get(part) {
+ if aliases.is_empty() {
+ return Some((*doc).into());
+ }
+ return Some(format!("{}\nAliases: {}", doc, aliases.join(", ")).into());
}
None