@@ -115,6 +115,9 @@ impl Component for BranchListComponent {
115
115
out. clear ( ) ;
116
116
}
117
117
118
+ let selection_is_cur_branch =
119
+ self . selection_is_cur_branch ( ) ;
120
+
118
121
out. push ( CommandInfo :: new (
119
122
strings:: commands:: scroll ( & self . key_config ) ,
120
123
true ,
@@ -139,7 +142,7 @@ impl Component for BranchListComponent {
139
142
strings:: commands:: compare_with_head (
140
143
& self . key_config ,
141
144
) ,
142
- !self . selection_is_cur_branch ( ) ,
145
+ !selection_is_cur_branch,
143
146
true ,
144
147
) ) ;
145
148
@@ -156,8 +159,7 @@ impl Component for BranchListComponent {
156
159
strings:: commands:: select_branch_popup (
157
160
& self . key_config ,
158
161
) ,
159
- !self . selection_is_cur_branch ( )
160
- && self . valid_selection ( ) ,
162
+ !selection_is_cur_branch && self . valid_selection ( ) ,
161
163
true ,
162
164
) ) ;
163
165
@@ -173,23 +175,23 @@ impl Component for BranchListComponent {
173
175
strings:: commands:: delete_branch_popup (
174
176
& self . key_config ,
175
177
) ,
176
- !self . selection_is_cur_branch ( ) ,
178
+ !selection_is_cur_branch,
177
179
true ,
178
180
) ) ;
179
181
180
182
out. push ( CommandInfo :: new (
181
183
strings:: commands:: merge_branch_popup (
182
184
& self . key_config ,
183
185
) ,
184
- !self . selection_is_cur_branch ( ) ,
186
+ !selection_is_cur_branch,
185
187
true ,
186
188
) ) ;
187
189
188
190
out. push ( CommandInfo :: new (
189
191
strings:: commands:: branch_popup_rebase (
190
192
& self . key_config ,
191
193
) ,
192
- !self . selection_is_cur_branch ( ) ,
194
+ !selection_is_cur_branch,
193
195
true ,
194
196
) ) ;
195
197
@@ -228,6 +230,9 @@ impl Component for BranchListComponent {
228
230
return Ok ( EventState :: Consumed ) ;
229
231
}
230
232
233
+ let selection_is_cur_branch =
234
+ self . selection_is_cur_branch ( ) ;
235
+
231
236
if key_match ( e, self . key_config . keys . enter ) {
232
237
try_or_popup ! (
233
238
self ,
@@ -243,12 +248,12 @@ impl Component for BranchListComponent {
243
248
{
244
249
self . rename_branch ( ) ;
245
250
} else if key_match ( e, self . key_config . keys . delete_branch )
246
- && !self . selection_is_cur_branch ( )
251
+ && !selection_is_cur_branch
247
252
&& self . valid_selection ( )
248
253
{
249
254
self . delete_branch ( ) ;
250
255
} else if key_match ( e, self . key_config . keys . merge_branch )
251
- && !self . selection_is_cur_branch ( )
256
+ && !selection_is_cur_branch
252
257
&& self . valid_selection ( )
253
258
{
254
259
try_or_popup ! (
@@ -257,7 +262,7 @@ impl Component for BranchListComponent {
257
262
self . merge_branch( )
258
263
) ;
259
264
} else if key_match ( e, self . key_config . keys . rebase_branch )
260
- && !self . selection_is_cur_branch ( )
265
+ && !selection_is_cur_branch
261
266
&& self . valid_selection ( )
262
267
{
263
268
try_or_popup ! (
0 commit comments