feat: toggle diff explorer and show file change indicators
This commit is contained in:
+8
-3
@@ -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()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user