mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 01:18:21 +00:00
ignore ctrl+c in commit to allow quitting
This commit is contained in:
parent
7e8e3a0bd5
commit
c638eb0329
1 changed files with 7 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ use crate::{
|
|||
strings, ui,
|
||||
};
|
||||
use asyncgit::{sync, CWD};
|
||||
use crossterm::event::{Event, KeyCode};
|
||||
use crossterm::event::{Event, KeyCode, KeyModifiers};
|
||||
use log::error;
|
||||
use std::borrow::Cow;
|
||||
use strings::commands;
|
||||
|
|
@ -76,11 +76,17 @@ impl Component for CommitComponent {
|
|||
fn event(&mut self, ev: Event) -> bool {
|
||||
if self.visible {
|
||||
if let Event::Key(e) = ev {
|
||||
let has_ctrl =
|
||||
e.modifiers.contains(KeyModifiers::CONTROL);
|
||||
match e.code {
|
||||
KeyCode::Esc => {
|
||||
self.hide();
|
||||
}
|
||||
KeyCode::Char(c) => {
|
||||
// ignore and early out on ctrl+c
|
||||
if c == 'c' && has_ctrl {
|
||||
return false;
|
||||
}
|
||||
self.msg.push(c);
|
||||
}
|
||||
KeyCode::Enter if self.can_commit() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue