diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bdad9ba..bdd1f423 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed * use [tombi](https://github.com/tombi-toml/tombi) for all toml file formatting * open the external editor from the status diff view [[@WaterWhisperer](https://github.com/WaterWhisperer)] ([#2805](https://github.com/gitui-org/gitui/issues/2805)) +* change diff mode toggle shortcut from `Alt+p` to `m` ### Fixes * crash when opening submodule ([#2895](https://github.com/gitui-org/gitui/issues/2895)) * when staging the last file in a directory, the first item after the directory is no longer skipped [[@Tillerino](https://github.com/Tillerino)] ([#2748](https://github.com/gitui-org/gitui/issues/2748)) +* fixed duplicated "Toggle Diff Mode" in help message ## [0.28.1] - 2026-03-21 diff --git a/src/components/diff.rs b/src/components/diff.rs index 4822d775..c98c1ef4 100644 --- a/src/components/diff.rs +++ b/src/components/diff.rs @@ -1710,4 +1710,35 @@ mod tests { if path == "src/main.rs" )); } + + #[test] + fn test_commands_no_longer_contains_toggle_diff() { + let env = Environment::test_env(); + let diff = DiffComponent::new(&env, false); + let mut cmds = Vec::new(); + diff.commands(&mut cmds, true); + + let contains_toggle = cmds.iter().any(|c| { + c.text.name + == strings::commands::diff_toggle_mode(&env.key_config) + .name + }); + assert!(!contains_toggle); + } + + #[test] + fn test_diff_mode_toggle_event() { + let env = Environment::test_env(); + let mut diff = DiffComponent::new(&env, false); + diff.focus(true); + + let event = Event::Key(KeyEvent::from( + &env.key_config.keys.diff_mode_toggle, + )); + + assert!(matches!( + diff.event(&event).unwrap(), + EventState::Consumed + )); + } }