@@ -610,12 +610,20 @@ impl ConventionalCommitPopup {
610
610
) ;
611
611
self . hide ( ) ;
612
612
}
613
+
614
+ fn next_step ( & mut self ) {
615
+ self . selected_index = 0 ;
616
+ self . is_insert = false ;
617
+ self . query = None ;
618
+ self . input . clear ( ) ;
619
+ self . update_query ( ) ;
620
+ }
613
621
}
614
622
615
623
impl DrawableComponent for ConventionalCommitPopup {
616
624
fn draw ( & self , f : & mut Frame , area : Rect ) -> Result < ( ) > {
617
625
if self . is_visible {
618
- const MAX_SIZE : ( u16 , u16 ) = ( 50 , 20 ) ;
626
+ const MAX_SIZE : ( u16 , u16 ) = ( 50 , 25 ) ;
619
627
620
628
let area = ui:: centered_rect_absolute (
621
629
MAX_SIZE . 0 , MAX_SIZE . 1 , area,
@@ -737,12 +745,7 @@ impl Component for ConventionalCommitPopup {
737
745
. cloned ( ) ;
738
746
739
747
self . seleted_commit_type = commit. clone ( ) ;
740
- self . selected_index = 0 ;
741
- self . is_insert = false ;
742
- self . query = None ;
743
- self . input . clear ( ) ;
744
-
745
- self . update_query ( ) ;
748
+ self . next_step ( ) ;
746
749
747
750
if let Some ( more_infos) =
748
751
commit. as_ref ( ) . map ( |c| c. more_info ( ) )
@@ -783,6 +786,7 @@ impl Component for ConventionalCommitPopup {
783
786
self . query_results_type [ idx]
784
787
. clone ( ) ,
785
788
) ;
789
+ self . next_step ( ) ;
786
790
}
787
791
}
788
792
}
@@ -800,14 +804,11 @@ impl Component for ConventionalCommitPopup {
800
804
}
801
805
802
806
fn hide ( & mut self ) {
807
+ self . next_step ( ) ;
803
808
self . is_visible = false ;
804
- self . is_insert = false ;
805
- self . selected_index = 0 ;
806
809
self . seleted_commit_type = None ;
807
- self . query = None ;
808
810
self . query_results_type = CommitType :: iter ( ) . collect_vec ( ) ;
809
811
self . query_results_more_info = Vec :: new ( ) ;
810
- self . input . clear ( ) ;
811
812
}
812
813
813
814
fn show ( & mut self ) -> Result < ( ) > {
0 commit comments