fix: omit diff explorer footer and reclaim its row

This commit is contained in:
2026-10-11 19:52:13 +02:00
parent 812152fd96
commit a69372fb6e
2 changed files with 12 additions and 20 deletions
+10 -19
View File
@@ -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()
};