From 0c1646432005d6e4bcd8f5123d884a2f6b434623 Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Fri, 3 Jun 2022 20:30:36 +0200 Subject: [PATCH] Use search terms in the help menu search (#5708) Currently only `help --find` was using the search terms. With this change they will also be used by the `F1` help menu --- crates/nu-cli/src/menus/help_completions.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/nu-cli/src/menus/help_completions.rs b/crates/nu-cli/src/menus/help_completions.rs index 12ad18fd96..c55dca9cf3 100644 --- a/crates/nu-cli/src/menus/help_completions.rs +++ b/crates/nu-cli/src/menus/help_completions.rs @@ -19,6 +19,10 @@ impl NuHelpCompleter { .filter(|(sig, _, _, _)| { sig.name.to_lowercase().contains(&line.to_lowercase()) || sig.usage.to_lowercase().contains(&line.to_lowercase()) + || sig + .search_terms + .iter() + .any(|term| term.to_lowercase().contains(&line.to_lowercase())) || sig .extra_usage .to_lowercase()