mirror of
https://github.com/nushell/nushell.git
synced 2024-12-23 23:49:44 +01:00
finish hooking up completion descriptions (#5047)
This commit is contained in:
parent
d89ad4fafd
commit
05f7d7d38b
@ -257,6 +257,7 @@ impl NuCompleter {
|
||||
let mut output = vec![];
|
||||
|
||||
for named in &sig.named {
|
||||
let flag_desc = &named.desc;
|
||||
if let Some(short) = named.short {
|
||||
let mut named = vec![0; short.len_utf8()];
|
||||
short.encode_utf8(&mut named);
|
||||
@ -264,7 +265,7 @@ impl NuCompleter {
|
||||
if named.starts_with(&prefix) {
|
||||
output.push(Suggestion {
|
||||
value: String::from_utf8_lossy(&named).to_string(),
|
||||
description: None,
|
||||
description: Some(flag_desc.to_string()),
|
||||
span: reedline::Span {
|
||||
start: new_span.start - offset,
|
||||
end: new_span.end - offset,
|
||||
@ -283,7 +284,7 @@ impl NuCompleter {
|
||||
if named.starts_with(&prefix) {
|
||||
output.push(Suggestion {
|
||||
value: String::from_utf8_lossy(&named).to_string(),
|
||||
description: None,
|
||||
description: Some(flag_desc.to_string()),
|
||||
span: reedline::Span {
|
||||
start: new_span.start - offset,
|
||||
end: new_span.end - offset,
|
||||
|
Loading…
Reference in New Issue
Block a user