Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vim bindings for navigation #11

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ use ratatui::{symbols, Frame, Terminal};
mod app;
mod bpf_program;

const TABLE_FOOTER: &str = "(q) quit | (↑) move up | (↓) move down | (↵) show graphs";
const TABLE_FOOTER: &str = "(q) quit | (↑,k) move up | (↓,j) move down | (↵) show graphs";
const GRAPHS_FOOTER: &str = "(q) quit | (↵) show program list";
const HEADER_COLS: [&str; 7] = [
"ID",
@@ -118,12 +118,12 @@ fn run_draw_loop<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> Result
if poll(Duration::from_millis(50))? {
if let Event::Key(key) = event::read()? {
match key.code {
KeyCode::Down => {
KeyCode::Down | KeyCode::Char('j')=> {
if !app.show_graphs {
app.next_program()
}
}
KeyCode::Up => {
KeyCode::Up | KeyCode::Char('k') => {
if !app.show_graphs {
app.previous_program()
}