Add ctrl-k and ctrl-j for up and down (#394)

This commit is contained in:
Luke Baker 2022-05-08 04:03:00 -04:00 committed by GitHub
parent 25afb5b2ed
commit e9d2ec4bf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,7 +343,7 @@ async fn key_handler(
query_results(app, search_mode, db).await.unwrap(); query_results(app, search_mode, db).await.unwrap();
} }
Key::Down | Key::Ctrl('n') => { Key::Down | Key::Ctrl('n' | 'j') => {
let i = match app.results_state.selected() { let i = match app.results_state.selected() {
Some(i) => { Some(i) => {
if i == 0 { if i == 0 {
@ -356,7 +356,7 @@ async fn key_handler(
}; };
app.results_state.select(Some(i)); app.results_state.select(Some(i));
} }
Key::Up | Key::Ctrl('p') => { Key::Up | Key::Ctrl('p' | 'k') => {
let i = match app.results_state.selected() { let i = match app.results_state.selected() {
Some(i) => { Some(i) => {
if i >= app.results.len() - 1 { if i >= app.results.len() - 1 {