@@ -138,10 +138,17 @@ impl App {
138
138
let left_chunks = Layout :: default ( )
139
139
. direction ( Direction :: Vertical )
140
140
. constraints (
141
- [
142
- Constraint :: Percentage ( 50 ) ,
143
- Constraint :: Percentage ( 50 ) ,
144
- ]
141
+ if self . diff_target == DiffTarget :: WorkingDir {
142
+ [
143
+ Constraint :: Percentage ( 60 ) ,
144
+ Constraint :: Percentage ( 40 ) ,
145
+ ]
146
+ } else {
147
+ [
148
+ Constraint :: Percentage ( 40 ) ,
149
+ Constraint :: Percentage ( 60 ) ,
150
+ ]
151
+ }
145
152
. as_ref ( ) ,
146
153
)
147
154
. split ( chunks[ 0 ] ) ;
@@ -187,6 +194,13 @@ impl App {
187
194
DiffTarget :: WorkingDir => Focus :: WorkDir ,
188
195
} )
189
196
}
197
+ keys:: OPEN_COMMIT
198
+ if !self . index . is_empty ( )
199
+ && self . offer_open_commit_cmd ( ) =>
200
+ {
201
+ self . commit . show ( ) ;
202
+ NeedsUpdate :: COMMANDS
203
+ }
190
204
_ => NeedsUpdate :: empty ( ) ,
191
205
} ;
192
206
@@ -295,7 +309,6 @@ impl App {
295
309
self . index_wd . update ( & status. work_dir ) ;
296
310
297
311
self . update_diff ( ) ;
298
- self . commit . set_stage_empty ( self . index . is_empty ( ) ) ;
299
312
self . update_commands ( ) ;
300
313
}
301
314
@@ -413,6 +426,33 @@ impl App {
413
426
) ) ;
414
427
}
415
428
429
+ res. push (
430
+ CommandInfo :: new (
431
+ commands:: COMMIT_OPEN ,
432
+ !self . index . is_empty ( ) ,
433
+ self . offer_open_commit_cmd ( ) ,
434
+ )
435
+ . order ( -1 ) ,
436
+ ) ;
437
+
438
+ res. push (
439
+ CommandInfo :: new (
440
+ commands:: SELECT_STAGING ,
441
+ true ,
442
+ self . focus == Focus :: WorkDir ,
443
+ )
444
+ . order ( -2 ) ,
445
+ ) ;
446
+
447
+ res. push (
448
+ CommandInfo :: new (
449
+ commands:: SELECT_UNSTAGED ,
450
+ true ,
451
+ self . focus == Focus :: Stage ,
452
+ )
453
+ . order ( -2 ) ,
454
+ ) ;
455
+
416
456
res. push (
417
457
CommandInfo :: new (
418
458
commands:: QUIT ,
@@ -426,6 +466,11 @@ impl App {
426
466
res
427
467
}
428
468
469
+ fn offer_open_commit_cmd ( & self ) -> bool {
470
+ !self . commit . is_visible ( )
471
+ && self . diff_target == DiffTarget :: Stage
472
+ }
473
+
429
474
fn components ( & self ) -> Vec < & dyn Component > {
430
475
vec ! [
431
476
& self . msg,
0 commit comments