Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix external completions; add a caret when there is overlap #7405

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
fix external completions; add a caret when there is overlap
  • Loading branch information
merelymyself committed Dec 9, 2022
commit b76806190ca272b0e64654f368c0515267a66547
5 changes: 4 additions & 1 deletion crates/nu-cli/src/completions/command_completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ impl CommandCompletion {
append_whitespace: true,
});

let results_strings: Vec<String> =
results.clone().into_iter().map(|x| x.value).collect();

for external in results_external {
if results.contains(&external) {
if results_strings.contains(&external.value) {
results.push(Suggestion {
value: format!("^{}", external.value),
description: None,
Expand Down