From c9d829a26dac81a57f18796308d3806d77d0c439 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 17 Jul 2024 08:41:57 -0500 Subject: [PATCH] global_search: Save search when accepting an option (#11209) The Prompt is set up to push the current line to history when hitting Enter but the Picker doesn't pass the Enter event down to the Prompt (for good reason: we don't want the Prompt's behavior of changing completions when we hit a path separator). We should save the Prompt's line to its configured history register when hitting Enter when there is a selection in the Picker. This currently only applies to `global_search`'s Picker since it's the only Picker to use `Picker::with_history_register`. --- helix-term/src/ui/picker.rs | 1 + helix-term/src/ui/prompt.rs | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 70be421ae..e2d15ed21 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -1031,6 +1031,7 @@ impl Component for Picker