Better search behaviour
This commit is contained in:
parent
9cc9729ed9
commit
b0b4de2f64
2 changed files with 3 additions and 7 deletions
|
|
@ -322,7 +322,7 @@ impl RawEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_open_finder(&self, selection: Option<String>) -> Option<Action> {
|
pub fn to_open_finder(&self, query: Option<String>) -> Option<Action> {
|
||||||
if matches!(
|
if matches!(
|
||||||
&self.0,
|
&self.0,
|
||||||
TerminalEvent::Key(KeyEvent {
|
TerminalEvent::Key(KeyEvent {
|
||||||
|
|
@ -332,7 +332,7 @@ impl RawEvent {
|
||||||
..
|
..
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
Some(Action::OpenFinder(selection))
|
Some(Action::OpenFinder(query))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,14 +70,10 @@ impl Element for Doc {
|
||||||
.to_owned()
|
.to_owned()
|
||||||
.unwrap_or_else(|| std::env::current_dir().expect("no working dir"));
|
.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| {
|
match event.to_action(|e| {
|
||||||
e.to_open_switcher()
|
e.to_open_switcher()
|
||||||
.or_else(|| e.to_open_opener(open_path))
|
.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_move())
|
||||||
.or_else(|| e.to_save())
|
.or_else(|| e.to_save())
|
||||||
}) {
|
}) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue