Stop passing check_exit events to match key bindings

check_exit events are generated to give the reader a chance to respond to
commands, or otherwise to return control to the reader loop. Prior to this
change they were being passed to match key bindings. This is useless since
no key binding can match a check_exit event. FLOG noisily complains about
unmatched events. So just don't pass these to mapping_execute.
This commit is contained in:
ridiculousfish 2022-01-30 11:29:35 -08:00
parent 0e6313b98b
commit 8a4ed096ed

View File

@ -673,9 +673,6 @@ void inputter_t::mapping_execute_matching_or_generic(const command_handler_t &co
FLOGF(reader, L"no generic found, ignoring char...");
auto evt = peeker.next();
if (evt.is_eof()) {
this->push_front(evt);
}
peeker.consume();
}
@ -750,7 +747,11 @@ char_event_t inputter_t::read_char(const command_handler_t &command_handler) {
// If we have EOF, we need to immediately quit.
// There's no need to go through the input functions.
return evt;
} else if (evt.is_check_exit()) {
// Allow the reader to check for exit conditions.
return evt;
} else {
assert(evt.is_char() && "Should be char event");
this->push_front(evt);
mapping_execute_matching_or_generic(command_handler);
// Regarding allow_commands, we're in a loop, but if a fish command is executed,