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 {
415
415
) ;
416
416
}
417
417
418
+ res. push (
419
+ CommandInfo :: new (
420
+ commands:: TOGGLE_TABS ,
421
+ true ,
422
+ !self . any_popup_visible ( ) ,
423
+ )
424
+ . hidden ( ) ,
425
+ ) ;
426
+
418
427
res. push (
419
428
CommandInfo :: new (
420
429
commands:: QUIT ,
Original file line number Diff line number Diff line change @@ -350,16 +350,15 @@ impl Component for DiffComponent {
350
350
. hidden ( ) ,
351
351
) ;
352
352
353
- let cmd_text = if self . current . is_stage {
354
- commands:: DIFF_HUNK_REMOVE
355
- } else {
356
- commands:: DIFF_HUNK_ADD
357
- } ;
358
-
359
353
out. push ( CommandInfo :: new (
360
- cmd_text ,
354
+ commands :: DIFF_HUNK_REMOVE ,
361
355
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 ,
363
362
) ) ;
364
363
365
364
CommandBlocking :: PassingOn
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ pub mod commands {
24
24
static CMD_GROUP_CHANGES : & str = "Changes" ;
25
25
static CMD_GROUP_COMMIT : & str = "Commit" ;
26
26
27
+ ///
28
+ pub static TOGGLE_TABS : CommandText = CommandText :: new (
29
+ "Tabs [tabs]" ,
30
+ "switch top level tabs" ,
31
+ CMD_GROUP_GENERAL ,
32
+ ) ;
27
33
///
28
34
pub static HELP_OPEN : CommandText = CommandText :: new (
29
35
"Help [h]" ,
You can’t perform that action at this time.
0 commit comments