File tree Expand file tree Collapse file tree 3 files changed +22
-8
lines changed
Expand file tree Collapse file tree 3 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -415,6 +415,15 @@ impl App {
415415 ) ;
416416 }
417417
418+ res. push (
419+ CommandInfo :: new (
420+ commands:: TOGGLE_TABS ,
421+ true ,
422+ !self . any_popup_visible ( ) ,
423+ )
424+ . hidden ( ) ,
425+ ) ;
426+
418427 res. push (
419428 CommandInfo :: new (
420429 commands:: QUIT ,
Original file line number Diff line number Diff line change @@ -350,16 +350,15 @@ impl Component for DiffComponent {
350350 . hidden ( ) ,
351351 ) ;
352352
353- let cmd_text = if self . current . is_stage {
354- commands:: DIFF_HUNK_REMOVE
355- } else {
356- commands:: DIFF_HUNK_ADD
357- } ;
358-
359353 out. push ( CommandInfo :: new (
360- cmd_text ,
354+ commands :: DIFF_HUNK_REMOVE ,
361355 self . selected_hunk . is_some ( ) ,
362- self . focused ,
356+ self . focused && self . current . is_stage ,
357+ ) ) ;
358+ out. push ( CommandInfo :: new (
359+ commands:: DIFF_HUNK_ADD ,
360+ self . selected_hunk . is_some ( ) ,
361+ self . focused && !self . current . is_stage ,
363362 ) ) ;
364363
365364 CommandBlocking :: PassingOn
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ pub mod commands {
2424 static CMD_GROUP_CHANGES : & str = "Changes" ;
2525 static CMD_GROUP_COMMIT : & str = "Commit" ;
2626
27+ ///
28+ pub static TOGGLE_TABS : CommandText = CommandText :: new (
29+ "Tabs [tabs]" ,
30+ "switch top level tabs" ,
31+ CMD_GROUP_GENERAL ,
32+ ) ;
2733 ///
2834 pub static HELP_OPEN : CommandText = CommandText :: new (
2935 "Help [h]" ,
You can’t perform that action at this time.
0 commit comments