From a17626a822b36d4de3146c2d410f976e19dd189c Mon Sep 17 00:00:00 2001 From: Termina94 <47091253+Termina94@users.noreply.github.com> Date: Tue, 21 Jun 2022 17:52:25 +0100 Subject: [PATCH] add history suggest to global search (#2717) Co-authored-by: Dean Revell --- helix-term/src/commands.rs | 6 ++++-- helix-view/src/tree.rs | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index d4fa34e0..68c585b0 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1747,11 +1747,13 @@ fn global_search(cx: &mut Context) { let smart_case = config.search.smart_case; let file_picker_config = config.file_picker.clone(); - let completions = search_completions(cx, None); + let reg = cx.register.unwrap_or('/'); + + let completions = search_completions(cx, Some(reg)); ui::regex_prompt( cx, "global-search:".into(), - None, + Some(reg), move |_editor: &Editor, input: &str| { completions .iter() diff --git a/helix-view/src/tree.rs b/helix-view/src/tree.rs index e6dba916..3ba85b56 100644 --- a/helix-view/src/tree.rs +++ b/helix-view/src/tree.rs @@ -233,7 +233,6 @@ impl Tree { { if let Some(pos) = container.children.iter().position(|&child| child == index) { container.children.remove(pos); - // TODO: if container now only has one child, remove it and place child in parent if container.children.is_empty() && parent_id != self.root { // if container now empty, remove it