Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion src/pane/diff_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ impl Pane for DiffPane {

fn handle_event(&mut self, event: &AppEvent) -> bool {
match event {
AppEvent::Key(key) => matches!(key.code, KeyCode::Char('j') | KeyCode::Char('k')),
AppEvent::Key(key) => matches!(
key.code,
KeyCode::Char('j')
| KeyCode::Char('k')
| KeyCode::Left
| KeyCode::Right
),
_ => false,
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/pane/help_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ impl Pane for HelpPane {
ActivePane::FileTree => (
"File Tree",
vec![
" Tab / g t - Next file",
" Shift+Tab / g T - Previous file",
" Tab / g t / Right - Next file",
" Shift+Tab / g T / Left - Previous file",
],
),
ActivePane::Monitor => (
Expand All @@ -87,6 +87,8 @@ impl Pane for HelpPane {
vec![
" j / Down / Ctrl+e - Scroll down",
" k / Up / Ctrl+y - Scroll up",
" Right - Next file",
" Left - Previous file",
" PageDown - Page down",
" PageUp - Page up",
" g g - Go to top",
Expand Down
10 changes: 10 additions & 0 deletions src/pane/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ impl GlobalKeyHandler {
app.page_up(app.current_diff_height);
KeyResult::Handled
}
KeyCode::Left => {
debug!("User pressed Left - previous file");
app.prev_file();
KeyResult::Handled
}
KeyCode::Right => {
debug!("User pressed Right - next file");
app.next_file();
KeyResult::Handled
}
KeyCode::Tab => {
debug!("User pressed Tab - next file");
app.next_file();
Expand Down
8 changes: 7 additions & 1 deletion src/pane/side_by_side_diff_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ impl Pane for SideBySideDiffPane {

fn handle_event(&mut self, event: &AppEvent) -> bool {
match event {
AppEvent::Key(key) => matches!(key.code, KeyCode::Char('j') | KeyCode::Char('k')),
AppEvent::Key(key) => matches!(
key.code,
KeyCode::Char('j')
| KeyCode::Char('k')
| KeyCode::Left
| KeyCode::Right
),
_ => false,
}
}
Expand Down
1 change: 1 addition & 0 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1742,6 +1742,7 @@ fn render_file_tree_content(f: &mut Frame, app: &App, area: Rect, _git_repo: &Gi
mod tests {
use super::*;
use crate::config::LlmConfig;
use log::debug;
use std::env;

fn create_test_app(
Expand Down