|
|
@ -3199,20 +3199,23 @@ pub(super) fn command_mode(cx: &mut Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
prompt.doc_fn = Box::new(|input: &str| {
|
|
|
|
|
|
|
|
let part = input.split(' ').next().unwrap_or_default();
|
|
|
|
if cx.editor.config().command_docs {
|
|
|
|
|
|
|
|
prompt.doc_fn = Box::new(|input: &str| {
|
|
|
|
if let Some(typed::TypableCommand { doc, aliases, .. }) =
|
|
|
|
let part = input.split(' ').next().unwrap_or_default();
|
|
|
|
typed::TYPABLE_COMMAND_MAP.get(part)
|
|
|
|
|
|
|
|
{
|
|
|
|
if let Some(typed::TypableCommand { doc, aliases, .. }) =
|
|
|
|
if aliases.is_empty() {
|
|
|
|
typed::TYPABLE_COMMAND_MAP.get(part)
|
|
|
|
return Some((*doc).into());
|
|
|
|
{
|
|
|
|
|
|
|
|
if aliases.is_empty() {
|
|
|
|
|
|
|
|
return Some((*doc).into());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Some(format!("{}\nAliases: {}", doc, aliases.join(", ")).into());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Some(format!("{}\nAliases: {}", doc, aliases.join(", ")).into());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
None
|
|
|
|
None
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Calculate initial completion
|
|
|
|
// Calculate initial completion
|
|
|
|
prompt.recalculate_completion(cx.editor);
|
|
|
|
prompt.recalculate_completion(cx.editor);
|
|
|
|