File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use crate::{
7
7
strings, ui,
8
8
} ;
9
9
use asyncgit:: { sync, CWD } ;
10
- use crossterm:: event:: { Event , KeyCode } ;
10
+ use crossterm:: event:: { Event , KeyCode , KeyModifiers } ;
11
11
use log:: error;
12
12
use std:: borrow:: Cow ;
13
13
use strings:: commands;
@@ -76,11 +76,17 @@ impl Component for CommitComponent {
76
76
fn event ( & mut self , ev : Event ) -> bool {
77
77
if self . visible {
78
78
if let Event :: Key ( e) = ev {
79
+ let has_ctrl =
80
+ e. modifiers . contains ( KeyModifiers :: CONTROL ) ;
79
81
match e. code {
80
82
KeyCode :: Esc => {
81
83
self . hide ( ) ;
82
84
}
83
85
KeyCode :: Char ( c) => {
86
+ // ignore and early out on ctrl+c
87
+ if c == 'c' && has_ctrl {
88
+ return false ;
89
+ }
84
90
self . msg . push ( c) ;
85
91
}
86
92
KeyCode :: Enter if self . can_commit ( ) => {
You can’t perform that action at this time.
0 commit comments