@@ -374,6 +374,7 @@ pub struct ConventionalCommitPopup {
374374 key_config : SharedKeyConfig ,
375375 is_visible : bool ,
376376 is_insert : bool ,
377+ is_breaking : bool ,
377378 query : Option < String > ,
378379 selected_index : usize ,
379380 options : Vec < CommitType > ,
@@ -399,6 +400,7 @@ impl ConventionalCommitPopup {
399400 query_results_type : CommitType :: iter ( ) . collect_vec ( ) ,
400401 query_results_more_info : Vec :: new ( ) ,
401402 is_insert : false ,
403+ is_breaking : false ,
402404 query : None ,
403405 is_visible : false ,
404406 key_config : env. key_config . clone ( ) ,
@@ -499,6 +501,7 @@ impl ConventionalCommitPopup {
499501 self . key_config . keys . move_down ,
500502 self . key_config . keys . move_up ,
501503 self . key_config . keys . exit_popup ,
504+ self . key_config . keys . breaking ,
502505 self . key_config . keys . exit ,
503506 self . key_config . keys . insert ,
504507 ]
@@ -608,7 +611,8 @@ impl ConventionalCommitPopup {
608611 self . queue . push ( crate :: queue:: InternalEvent :: OpenCommit ) ;
609612 self . queue . push (
610613 crate :: queue:: InternalEvent :: AddCommitMessage ( format ! (
611- "{emoji} {commit_type}{} {short_msg}" ,
614+ "{emoji} {commit_type}{}{} {short_msg}" ,
615+ if self . is_breaking { "!" } else { "" } ,
612616 if short_msg. is_empty( ) { "" } else { ":" } ,
613617 ) ) ,
614618 ) ;
@@ -646,6 +650,14 @@ impl DrawableComponent for ConventionalCommitPopup {
646650 } ,
647651 self . theme . title ( true ) ,
648652 ) )
653+ . title ( if self . is_breaking {
654+ Span :: styled (
655+ "[BREAKING]" ,
656+ self . theme . title ( true ) ,
657+ )
658+ } else {
659+ "" . into ( )
660+ } )
649661 . title ( if self . is_insert {
650662 Span :: styled (
651663 "[INSERT]" ,
@@ -759,6 +771,11 @@ impl Component for ConventionalCommitPopup {
759771 }
760772 }
761773 }
774+ } else if key_match (
775+ key,
776+ self . key_config . keys . breaking ,
777+ ) {
778+ self . is_breaking = !self . is_breaking ;
762779 } else if key_match (
763780 key,
764781 self . key_config . keys . popup_down ,
0 commit comments