File tree 3 files changed +40
-45
lines changed
3 files changed +40
-45
lines changed Original file line number Diff line number Diff line change @@ -99,26 +99,22 @@ impl Component for HelpComponent {
99
99
out. clear ( ) ;
100
100
}
101
101
102
- out. push (
103
- CommandInfo :: new (
104
- commands:: HELP_OPEN ,
102
+ if self . visible {
103
+ out. push ( CommandInfo :: new ( commands:: SCROLL , true , true ) ) ;
104
+
105
+ out. push ( CommandInfo :: new (
106
+ commands:: CLOSE_POPUP ,
105
107
true ,
106
- !self . visible ,
107
- )
108
- . order ( 99 ) ,
109
- ) ;
110
-
111
- out. push ( CommandInfo :: new (
112
- commands:: SCROLL ,
113
- true ,
114
- self . visible ,
115
- ) ) ;
116
-
117
- out. push ( CommandInfo :: new (
118
- commands:: CLOSE_POPUP ,
119
- true ,
120
- self . visible ,
121
- ) ) ;
108
+ true ,
109
+ ) ) ;
110
+ }
111
+
112
+ if !self . visible || force_all {
113
+ out. push (
114
+ CommandInfo :: new ( commands:: HELP_OPEN , true , true )
115
+ . order ( 99 ) ,
116
+ ) ;
117
+ }
122
118
123
119
visibility_blocking ( self )
124
120
}
Original file line number Diff line number Diff line change @@ -75,28 +75,24 @@ impl Component for InspectCommitComponent {
75
75
force_all,
76
76
self . components ( ) . as_slice ( ) ,
77
77
) ;
78
- }
79
78
80
- out. push (
81
- CommandInfo :: new (
82
- commands:: CLOSE_POPUP ,
79
+ out. push (
80
+ CommandInfo :: new ( commands:: CLOSE_POPUP , true , true )
81
+ . order ( 1 ) ,
82
+ ) ;
83
+
84
+ out. push ( CommandInfo :: new (
85
+ commands:: DIFF_FOCUS_RIGHT ,
86
+ self . can_focus_diff ( ) ,
87
+ !self . diff . focused ( ) || force_all,
88
+ ) ) ;
89
+
90
+ out. push ( CommandInfo :: new (
91
+ commands:: DIFF_FOCUS_LEFT ,
83
92
true ,
84
- self . is_visible ( ) ,
85
- )
86
- . order ( 1 ) ,
87
- ) ;
88
-
89
- out. push ( CommandInfo :: new (
90
- commands:: DIFF_FOCUS_RIGHT ,
91
- self . can_focus_diff ( ) ,
92
- ( self . is_visible ( ) && !self . diff . focused ( ) ) || force_all,
93
- ) ) ;
94
-
95
- out. push ( CommandInfo :: new (
96
- commands:: DIFF_FOCUS_LEFT ,
97
- true ,
98
- ( self . is_visible ( ) && self . diff . focused ( ) ) || force_all,
99
- ) ) ;
93
+ self . diff . focused ( ) || force_all,
94
+ ) ) ;
95
+ }
100
96
101
97
visibility_blocking ( self )
102
98
}
Original file line number Diff line number Diff line change @@ -38,13 +38,16 @@ impl Component for StashMsgComponent {
38
38
out : & mut Vec < CommandInfo > ,
39
39
force_all : bool ,
40
40
) -> CommandBlocking {
41
- self . input . commands ( out, force_all) ;
41
+ if self . is_visible ( ) || force_all {
42
+ self . input . commands ( out, force_all) ;
43
+
44
+ out. push ( CommandInfo :: new (
45
+ commands:: STASHING_CONFIRM_MSG ,
46
+ true ,
47
+ true ,
48
+ ) ) ;
49
+ }
42
50
43
- out. push ( CommandInfo :: new (
44
- commands:: STASHING_CONFIRM_MSG ,
45
- true ,
46
- self . is_visible ( ) || force_all,
47
- ) ) ;
48
51
visibility_blocking ( self )
49
52
}
50
53
You can’t perform that action at this time.
0 commit comments