From d50e17b3531a7f37469208a24dc63fa41fd59e87 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Sat, 24 Apr 2021 15:40:16 +0200 Subject: [PATCH] give blame a more apropriate place in command list --- src/components/filetree.rs | 13 ++++++++----- src/strings.rs | 11 ++++++----- src/tabs/status.rs | 30 ++++++++++++++++++++---------- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/components/filetree.rs b/src/components/filetree.rs index 7ccda00e..b1e03bb7 100644 --- a/src/components/filetree.rs +++ b/src/components/filetree.rs @@ -388,11 +388,14 @@ impl Component for FileTreeComponent { ) .order(order::NAV), ); - out.push(CommandInfo::new( - strings::commands::blame_file(&self.key_config), - self.selection_file().is_some(), - self.focused || force_all, - )); + out.push( + CommandInfo::new( + strings::commands::blame_file(&self.key_config), + self.selection_file().is_some(), + self.focused || force_all, + ) + .order(order::RARE_ACTION), + ); CommandBlocking::PassingOn } diff --git a/src/strings.rs b/src/strings.rs index 79c7c511..28726b8a 100644 --- a/src/strings.rs +++ b/src/strings.rs @@ -1,7 +1,8 @@ use crate::keys::SharedKeyConfig; pub mod order { - pub static NAV: i8 = 1; + pub static NAV: i8 = 2; + pub static RARE_ACTION: i8 = 1; } pub static PUSH_POPUP_MSG: &str = "Push"; @@ -585,7 +586,7 @@ pub mod commands { pub fn edit_item(key_config: &SharedKeyConfig) -> CommandText { CommandText::new( format!( - "Edit Item [{}]", + "Edit [{}]", key_config.get_hint(key_config.edit_file), ), "edit the currently selected file in an external editor", @@ -595,7 +596,7 @@ pub mod commands { pub fn stage_item(key_config: &SharedKeyConfig) -> CommandText { CommandText::new( format!( - "Stage Item [{}]", + "Stage [{}]", key_config.get_hint(key_config.enter), ), "stage currently selected file or entire path", @@ -615,7 +616,7 @@ pub mod commands { pub fn unstage_item(key_config: &SharedKeyConfig) -> CommandText { CommandText::new( format!( - "Unstage Item [{}]", + "Unstage [{}]", key_config.get_hint(key_config.enter), ), "unstage currently selected file or entire path", @@ -635,7 +636,7 @@ pub mod commands { pub fn reset_item(key_config: &SharedKeyConfig) -> CommandText { CommandText::new( format!( - "Reset Item [{}]", + "Reset [{}]", key_config.get_hint(key_config.status_reset_item), ), "revert changes in selected file or entire path", diff --git a/src/tabs/status.rs b/src/tabs/status.rs index 3836daef..518be7de 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -516,16 +516,26 @@ impl Component for Status { }, self.visible || force_all, )); - out.push(CommandInfo::new( - strings::commands::diff_focus_left(&self.key_config), - true, - (self.visible && focus_on_diff) || force_all, - )); - out.push(CommandInfo::new( - strings::commands::diff_focus_right(&self.key_config), - self.can_focus_diff(), - (self.visible && !focus_on_diff) || force_all, - )); + out.push( + CommandInfo::new( + strings::commands::diff_focus_left( + &self.key_config, + ), + true, + (self.visible && focus_on_diff) || force_all, + ) + .order(strings::order::NAV), + ); + out.push( + CommandInfo::new( + strings::commands::diff_focus_right( + &self.key_config, + ), + self.can_focus_diff(), + (self.visible && !focus_on_diff) || force_all, + ) + .order(strings::order::NAV), + ); out.push( CommandInfo::new( strings::commands::select_staging(