Skip to content

Commit d50e17b

Browse files
author
Stephan Dilly
committed
give blame a more apropriate place in command list
1 parent 82c52ce commit d50e17b

File tree

3 files changed

+34
-20
lines changed

3 files changed

+34
-20
lines changed

src/components/filetree.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,14 @@ impl Component for FileTreeComponent {
388388
)
389389
.order(order::NAV),
390390
);
391-
out.push(CommandInfo::new(
392-
strings::commands::blame_file(&self.key_config),
393-
self.selection_file().is_some(),
394-
self.focused || force_all,
395-
));
391+
out.push(
392+
CommandInfo::new(
393+
strings::commands::blame_file(&self.key_config),
394+
self.selection_file().is_some(),
395+
self.focused || force_all,
396+
)
397+
.order(order::RARE_ACTION),
398+
);
396399

397400
CommandBlocking::PassingOn
398401
}

src/strings.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use crate::keys::SharedKeyConfig;
22

33
pub mod order {
4-
pub static NAV: i8 = 1;
4+
pub static NAV: i8 = 2;
5+
pub static RARE_ACTION: i8 = 1;
56
}
67

78
pub static PUSH_POPUP_MSG: &str = "Push";
@@ -585,7 +586,7 @@ pub mod commands {
585586
pub fn edit_item(key_config: &SharedKeyConfig) -> CommandText {
586587
CommandText::new(
587588
format!(
588-
"Edit Item [{}]",
589+
"Edit [{}]",
589590
key_config.get_hint(key_config.edit_file),
590591
),
591592
"edit the currently selected file in an external editor",
@@ -595,7 +596,7 @@ pub mod commands {
595596
pub fn stage_item(key_config: &SharedKeyConfig) -> CommandText {
596597
CommandText::new(
597598
format!(
598-
"Stage Item [{}]",
599+
"Stage [{}]",
599600
key_config.get_hint(key_config.enter),
600601
),
601602
"stage currently selected file or entire path",
@@ -615,7 +616,7 @@ pub mod commands {
615616
pub fn unstage_item(key_config: &SharedKeyConfig) -> CommandText {
616617
CommandText::new(
617618
format!(
618-
"Unstage Item [{}]",
619+
"Unstage [{}]",
619620
key_config.get_hint(key_config.enter),
620621
),
621622
"unstage currently selected file or entire path",
@@ -635,7 +636,7 @@ pub mod commands {
635636
pub fn reset_item(key_config: &SharedKeyConfig) -> CommandText {
636637
CommandText::new(
637638
format!(
638-
"Reset Item [{}]",
639+
"Reset [{}]",
639640
key_config.get_hint(key_config.status_reset_item),
640641
),
641642
"revert changes in selected file or entire path",

src/tabs/status.rs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -516,16 +516,26 @@ impl Component for Status {
516516
},
517517
self.visible || force_all,
518518
));
519-
out.push(CommandInfo::new(
520-
strings::commands::diff_focus_left(&self.key_config),
521-
true,
522-
(self.visible && focus_on_diff) || force_all,
523-
));
524-
out.push(CommandInfo::new(
525-
strings::commands::diff_focus_right(&self.key_config),
526-
self.can_focus_diff(),
527-
(self.visible && !focus_on_diff) || force_all,
528-
));
519+
out.push(
520+
CommandInfo::new(
521+
strings::commands::diff_focus_left(
522+
&self.key_config,
523+
),
524+
true,
525+
(self.visible && focus_on_diff) || force_all,
526+
)
527+
.order(strings::order::NAV),
528+
);
529+
out.push(
530+
CommandInfo::new(
531+
strings::commands::diff_focus_right(
532+
&self.key_config,
533+
),
534+
self.can_focus_diff(),
535+
(self.visible && !focus_on_diff) || force_all,
536+
)
537+
.order(strings::order::NAV),
538+
);
529539
out.push(
530540
CommandInfo::new(
531541
strings::commands::select_staging(

0 commit comments

Comments
 (0)