fixed bug when searching
This commit is contained in:
BIN
revert.zip
Normal file
BIN
revert.zip
Normal file
Binary file not shown.
19
src/main.rs
19
src/main.rs
@@ -255,15 +255,6 @@ fn run_app(terminal: &mut Terminal<CrosstermBackend<io::Stdout>>) -> io::Result<
|
||||
}
|
||||
|
||||
fn handle_key(app: &mut App, code: KeyCode) {
|
||||
// Normalize arrow navigation
|
||||
let code = match code {
|
||||
KeyCode::Right => KeyCode::Enter,
|
||||
KeyCode::Left => KeyCode::Esc,
|
||||
KeyCode::Char('l') => KeyCode::Enter,
|
||||
KeyCode::Char('h') => KeyCode::Esc,
|
||||
other => other,
|
||||
};
|
||||
|
||||
// Special input handling in Login view
|
||||
if matches!(app.current_view(), View::Login) {
|
||||
match code {
|
||||
@@ -399,6 +390,16 @@ fn handle_key(app: &mut App, code: KeyCode) {
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize arrow navigation
|
||||
let code = match code {
|
||||
KeyCode::Right => KeyCode::Enter,
|
||||
KeyCode::Left => KeyCode::Esc,
|
||||
KeyCode::Char('l') => KeyCode::Enter,
|
||||
KeyCode::Char('h') => KeyCode::Esc,
|
||||
other => other,
|
||||
};
|
||||
|
||||
|
||||
// q behavior: if not home, go home; if home, quit
|
||||
if matches!(code, KeyCode::Char('q')) {
|
||||
if !matches!(app.current_view(), View::Categories) {
|
||||
|
||||
Reference in New Issue
Block a user