diff --git a/src/client.cc b/src/client.cc index 9abff701..f48e1c09 100644 --- a/src/client.cc +++ b/src/client.cc @@ -60,33 +60,32 @@ void Client::handle_available_input(EventMode mode) killpg(getpgrp(), SIGINT); else m_pending_keys.push_back(key); + return; } - else + + try { - try + while (Optional key = get_next_key(mode)) { - while (Optional key = get_next_key(mode)) - { - if (*key == ctrl('c')) - killpg(getpgrp(), SIGINT); - else if (*key == Key::FocusIn) - context().hooks().run_hook("FocusIn", context().name(), context()); - else if (*key == Key::FocusOut) - context().hooks().run_hook("FocusOut", context().name(), context()); - else - m_input_handler.handle_key(*key); - } - } - catch (Kakoune::runtime_error& error) - { - context().print_status({ error.what().str(), get_face("Error") }); - context().hooks().run_hook("RuntimeError", error.what(), context()); - } - catch (Kakoune::client_removed&) - { - ClientManager::instance().remove_client(*this); + if (*key == ctrl('c')) + killpg(getpgrp(), SIGINT); + else if (*key == Key::FocusIn) + context().hooks().run_hook("FocusIn", context().name(), context()); + else if (*key == Key::FocusOut) + context().hooks().run_hook("FocusOut", context().name(), context()); + else + m_input_handler.handle_key(*key); } } + catch (Kakoune::runtime_error& error) + { + context().print_status({ error.what().str(), get_face("Error") }); + context().hooks().run_hook("RuntimeError", error.what(), context()); + } + catch (Kakoune::client_removed&) + { + ClientManager::instance().remove_client(*this); + } } void Client::print_status(DisplayLine status_line)