@@ -3,9 +3,9 @@ use crate::{
3
3
cmdbar:: CommandBar ,
4
4
components:: {
5
5
event_pump, CommandBlocking , CommandInfo , CommitComponent ,
6
- Component , DrawableComponent , HelpComponent ,
7
- InspectCommitComponent , MsgComponent , ResetComponent ,
8
- StashMsgComponent ,
6
+ Component , DrawableComponent , ExternalEditorComponent ,
7
+ HelpComponent , InspectCommitComponent , MsgComponent ,
8
+ ResetComponent , StashMsgComponent ,
9
9
} ,
10
10
input:: { Input , InputEvent , InputState } ,
11
11
keys,
@@ -35,6 +35,7 @@ pub struct App {
35
35
commit : CommitComponent ,
36
36
stashmsg_popup : StashMsgComponent ,
37
37
inspect_commit_popup : InspectCommitComponent ,
38
+ external_editor_popup : ExternalEditorComponent ,
38
39
cmdbar : RefCell < CommandBar > ,
39
40
tab : usize ,
40
41
revlog : Revlog ,
@@ -76,6 +77,9 @@ impl App {
76
77
sender,
77
78
theme. clone ( ) ,
78
79
) ,
80
+ external_editor_popup : ExternalEditorComponent :: new (
81
+ theme. clone ( ) ,
82
+ ) ,
79
83
do_quit : false ,
80
84
cmdbar : RefCell :: new ( CommandBar :: new ( theme. clone ( ) ) ) ,
81
85
help : HelpComponent :: new ( theme. clone ( ) ) ,
@@ -190,6 +194,7 @@ impl App {
190
194
self . update_commands ( ) ;
191
195
}
192
196
} else if let InputEvent :: State ( polling_state) = ev {
197
+ self . external_editor_popup . hide ( ) ;
193
198
if let InputState :: Paused = polling_state {
194
199
if let Err ( e) = self . commit . show_editor ( ) {
195
200
let msg =
@@ -274,6 +279,7 @@ impl App {
274
279
commit,
275
280
stashmsg_popup,
276
281
inspect_commit_popup,
282
+ external_editor_popup,
277
283
help,
278
284
revlog,
279
285
status_tab,
@@ -404,6 +410,8 @@ impl App {
404
410
}
405
411
InternalEvent :: SuspendPolling => {
406
412
self . input . set_polling ( false ) ;
413
+ self . external_editor_popup . show ( ) ?;
414
+ flags. insert ( NeedsUpdate :: COMMANDS )
407
415
}
408
416
} ;
409
417
@@ -458,6 +466,7 @@ impl App {
458
466
|| self . msg . is_visible ( )
459
467
|| self . stashmsg_popup . is_visible ( )
460
468
|| self . inspect_commit_popup . is_visible ( )
469
+ || self . external_editor_popup . is_visible ( )
461
470
}
462
471
463
472
fn draw_popups < B : Backend > (
@@ -481,6 +490,7 @@ impl App {
481
490
self . help . draw ( f, size) ?;
482
491
self . msg . draw ( f, size) ?;
483
492
self . inspect_commit_popup . draw ( f, size) ?;
493
+ self . external_editor_popup . draw ( f, size) ?;
484
494
485
495
Ok ( ( ) )
486
496
}
0 commit comments