diff --git a/src/action/interactive.rs b/src/action/interactive.rs index 4d8eed60..b8228e5a 100644 --- a/src/action/interactive.rs +++ b/src/action/interactive.rs @@ -384,7 +384,7 @@ impl UserPicked { } loop { - let mut guard = ScopedRaw::new(); + let guard = ScopedRaw::new(); self.print_replacements_list(state)?; @@ -403,11 +403,14 @@ impl UserPicked { } let event = match crossterm::event::read() + .map(move |event| { + drop(guard); + event + }) .map_err(|e| anyhow::anyhow!("Something unexpected happened on the CLI: {}", e))? { Event::Key(event) => event, Event::Resize(..) => { - drop(guard); continue; } sth => { @@ -417,9 +420,8 @@ impl UserPicked { }; if state.is_custom_entry() { - drop(guard); info!("Custom entry mode"); - guard = ScopedRaw::new(); + let _guard = ScopedRaw::new(); let pick = self.enter_custom_replacement(state, event)?; @@ -435,7 +437,6 @@ impl UserPicked { } } - drop(guard); // print normally again trace!("registered event: {:?}", &event);