@@ -374,6 +374,7 @@ pub struct ConventionalCommitPopup {
374
374
key_config : SharedKeyConfig ,
375
375
is_visible : bool ,
376
376
is_insert : bool ,
377
+ is_breaking : bool ,
377
378
query : Option < String > ,
378
379
selected_index : usize ,
379
380
options : Vec < CommitType > ,
@@ -399,6 +400,7 @@ impl ConventionalCommitPopup {
399
400
query_results_type : CommitType :: iter ( ) . collect_vec ( ) ,
400
401
query_results_more_info : Vec :: new ( ) ,
401
402
is_insert : false ,
403
+ is_breaking : false ,
402
404
query : None ,
403
405
is_visible : false ,
404
406
key_config : env. key_config . clone ( ) ,
@@ -499,6 +501,7 @@ impl ConventionalCommitPopup {
499
501
self . key_config . keys . move_down ,
500
502
self . key_config . keys . move_up ,
501
503
self . key_config . keys . exit_popup ,
504
+ self . key_config . keys . breaking ,
502
505
self . key_config . keys . exit ,
503
506
self . key_config . keys . insert ,
504
507
]
@@ -608,7 +611,8 @@ impl ConventionalCommitPopup {
608
611
self . queue . push ( crate :: queue:: InternalEvent :: OpenCommit ) ;
609
612
self . queue . push (
610
613
crate :: queue:: InternalEvent :: AddCommitMessage ( format ! (
611
- "{emoji} {commit_type}{} {short_msg}" ,
614
+ "{emoji} {commit_type}{}{} {short_msg}" ,
615
+ if self . is_breaking { "!" } else { "" } ,
612
616
if short_msg. is_empty( ) { "" } else { ":" } ,
613
617
) ) ,
614
618
) ;
@@ -646,6 +650,14 @@ impl DrawableComponent for ConventionalCommitPopup {
646
650
} ,
647
651
self . theme . title ( true ) ,
648
652
) )
653
+ . title ( if self . is_breaking {
654
+ Span :: styled (
655
+ "[BREAKING]" ,
656
+ self . theme . title ( true ) ,
657
+ )
658
+ } else {
659
+ "" . into ( )
660
+ } )
649
661
. title ( if self . is_insert {
650
662
Span :: styled (
651
663
"[INSERT]" ,
@@ -759,6 +771,11 @@ impl Component for ConventionalCommitPopup {
759
771
}
760
772
}
761
773
}
774
+ } else if key_match (
775
+ key,
776
+ self . key_config . keys . breaking ,
777
+ ) {
778
+ self . is_breaking = !self . is_breaking ;
762
779
} else if key_match (
763
780
key,
764
781
self . key_config . keys . popup_down ,
0 commit comments