From b0b4de2f64a30e5372e5c0eabad8a3b469b603b8 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 23 Sep 2025 14:32:47 +0100 Subject: [PATCH] Better search behaviour --- src/action.rs | 4 ++-- src/ui/doc.rs | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/action.rs b/src/action.rs index 17b830b..8ee2083 100644 --- a/src/action.rs +++ b/src/action.rs @@ -322,7 +322,7 @@ impl RawEvent { } } - pub fn to_open_finder(&self, selection: Option) -> Option { + pub fn to_open_finder(&self, query: Option) -> Option { if matches!( &self.0, TerminalEvent::Key(KeyEvent { @@ -332,7 +332,7 @@ impl RawEvent { .. }) ) { - Some(Action::OpenFinder(selection)) + Some(Action::OpenFinder(query)) } else { None } diff --git a/src/ui/doc.rs b/src/ui/doc.rs index 7f73c3c..422e446 100644 --- a/src/ui/doc.rs +++ b/src/ui/doc.rs @@ -70,14 +70,10 @@ impl Element for Doc { .to_owned() .unwrap_or_else(|| std::env::current_dir().expect("no working dir")); - let selection = buffer.cursors[cursor_id] - .selection() - .map(|range| buffer.text.chars()[range].iter().copied().collect()); - match event.to_action(|e| { e.to_open_switcher() .or_else(|| e.to_open_opener(open_path)) - .or_else(|| e.to_open_finder(selection)) + .or_else(|| e.to_open_finder(None)) .or_else(|| e.to_move()) .or_else(|| e.to_save()) }) {