Get rid of shift+q for closing cove

I'd like to be able to type a capital Q in text fields.
This commit is contained in:
Joscha 2022-07-26 13:30:14 +02:00
parent c6b0193849
commit 227a5a67b1

View file

@ -193,10 +193,11 @@ impl Ui {
terminal: &mut Terminal,
crossterm_lock: &Arc<FairMutex<()>>,
) -> EventHandleResult {
// Always exit when shift+q or ctrl+c are pressed
let shift_q = event.code == KeyCode::Char('Q');
// Always exit when ctrl+c is pressed. Previously, shift+q would also
// unconditionally quit cove, but that interfered with typing text in
// inline editors.
let ctrl_c = event.modifiers == KeyModifiers::CONTROL && event.code == KeyCode::Char('c');
if shift_q || ctrl_c {
if ctrl_c {
return EventHandleResult::Stop;
}