Changed search function to always act as home
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -1352,17 +1352,9 @@ fn handle_key(app: &mut App, code: KeyCode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
KeyCode::Char('/') => {
|
KeyCode::Char('/') => {
|
||||||
let scope = match app.current_view() {
|
// Always behave like home-page search (global), regardless of current view.
|
||||||
View::Categories => SearchScope::All,
|
|
||||||
View::Library { title, query, .. } => SearchScope::Library {
|
|
||||||
title: title.clone(),
|
|
||||||
query: query.clone(),
|
|
||||||
},
|
|
||||||
_ => SearchScope::All,
|
|
||||||
};
|
|
||||||
|
|
||||||
app.search = Some(SearchState {
|
app.search = Some(SearchState {
|
||||||
scope,
|
scope: SearchScope::All,
|
||||||
mode: SearchMode::All,
|
mode: SearchMode::All,
|
||||||
input: String::new(),
|
input: String::new(),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user