From a69372fb6e1e54b1fc93f234a467caab2d82a38e Mon Sep 17 00:00:00 2001 From: hl-valdemar Date: Sun, 11 Oct 2026 19:52:13 +0200 Subject: [PATCH] fix: omit diff explorer footer and reclaim its row --- TODO.md | 3 ++- src/tui.rs | 29 ++++++++++------------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/TODO.md b/TODO.md index 6edd28b..65c1285 100644 --- a/TODO.md +++ b/TODO.md @@ -4,8 +4,9 @@ - [x] add panes/splits: split current pane above/below (`_`) or left/right (`|`) in Normal mode; navigate panes with Option/Alt+h/j/k/l. - shared split layout and directional focus with diff views; independent pane views, shared buffers, and guarded close/force-close actions. - [x] remove diff viewer's file explorer's `A added M modified...` explanation - it's standard and the explanation doesn't fit in the pane, so it can go. -- [ ] add tabs: tab support, editor action to open a buffer in a new tab, default tab navigation is `ctrl+option+h/l`, close tab action. + - no replacement help footer in diff file lists; reclaim its row for file entries. - [ ] diff view: add character-wise change highlight (enabled by default). +- [ ] add tabs: tab support, editor action to open a buffer in a new tab, default tab navigation is `ctrl+option+h/l`, close tab action. - [ ] diff view: lsp actions should act as they normally would. if an lsp action would open another file, then the file should be opened in another tab outside the diff view - if the referenced file/symbol is part of the changes in the diff, it should just be opened in the diff view. - this will require tab support. - [ ] diff view: change diff view modes; choose between split and unified diff view (split by default). diff --git a/src/tui.rs b/src/tui.rs index 75b47d9..3e346bf 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -3395,7 +3395,7 @@ fn draw_file_list( } let show_root = content.height >= 4 && !picker.root.as_os_str().is_empty(); let show_error = picker.error.is_some() && content.height >= 2; - let show_help = content.height >= 5 + u16::from(show_error); + let show_help = changed_files.is_none() && content.height >= 5 + u16::from(show_error); let root = show_root.then(|| { Paragraph::new(display_text(&picker.root.to_string_lossy())) .style(Style::default().fg(Color::DarkGray)) @@ -3550,27 +3550,18 @@ fn draw_file_list( )); } } + if !show_help { + return; + } let help = if picker.focused { - let controls = if changed_files.is_some() { - if browsing { - "Enter · i filter · Esc close · Tab panes · ^T view" - } else { - "Enter · Esc · Tab panes · ^T view" - } - } else { - match (picker.presentation, browsing) { - (FilePresentation::Floating, true) => "Enter · i filter · Esc/^W close · ^R · ^T", - (FilePresentation::Docked, true) => { - "Enter · i filter · Esc/Tab edit · ^W · ^R · ^T" - } - (_, false) if picker.view == FileView::Tree => "Enter · Esc NORMAL · ^W · ^R · ^T", - (FilePresentation::Floating, false) => "Enter · Esc/^W close · ^R · ^T", - (FilePresentation::Docked, false) => "Enter · Esc/Tab edit · ^W · ^R · ^T", - } + let controls = match (picker.presentation, browsing) { + (FilePresentation::Floating, true) => "Enter · i filter · Esc/^W close · ^R · ^T", + (FilePresentation::Docked, true) => "Enter · i filter · Esc/Tab edit · ^W · ^R · ^T", + (_, false) if picker.view == FileView::Tree => "Enter · Esc NORMAL · ^W · ^R · ^T", + (FilePresentation::Floating, false) => "Enter · Esc/^W close · ^R · ^T", + (FilePresentation::Docked, false) => "Enter · Esc/Tab edit · ^W · ^R · ^T", }; format!("^U clear · {navigation_hint} · {controls}") - } else if changed_files.is_some() { - "Editor focus · Tab to browse changed files".into() } else { "Editor focus · invoke explorer to browse".into() };