feat: toggle diff explorer and show file change indicators

This commit is contained in:
2026-10-11 00:54:35 +02:00
parent 83c37f5a19
commit 2f595ca4ca
9 changed files with 454 additions and 38 deletions
+8 -3
View File
@@ -1279,8 +1279,13 @@ impl Editor {
}
fn handle_diff(&mut self, input: Input) {
// Escape and Tab always retain their modal close/back/focus semantics.
if !matches!(input, Input::Escape | Input::Char('\t') | Input::BackTab) {
// Modal controls take precedence over configured browsing bindings.
let toggle_files = input == Input::Ctrl('e')
&& self
.diff
.as_ref()
.is_some_and(|diff| diff.phase == Phase::View);
if !toggle_files && !matches!(input, Input::Escape | Input::Char('\t') | Input::BackTab) {
if self.handle_tree_binding(&input) {
return;
}
@@ -2620,7 +2625,7 @@ impl Editor {
fn handle_tree_binding(&mut self, input: &Input) -> bool {
let picker = if let Some(diff) = &mut self.diff {
diff.files.as_mut()
diff.files.as_mut().filter(|_| diff.files_visible)
} else {
self.file_picker.as_mut()
};