Quit immediately with R_EOF

If we read an R_EOF, we'd try to match mappings to it.

In emacs mode, that's not an issue because the generic binding was
always available, but in vi-normal mode there is no generic binding,
so we'd endlessly loop, waiting for another character.

Fixes #5528.
This commit is contained in:
Fabian Homborg 2019-01-28 18:10:41 +01:00
parent d8d9cfdc10
commit ac3d3c399c

View File

@ -515,6 +515,10 @@ wint_t input_readch(bool allow_commands) {
}
default: { return c; }
}
} else if (c == R_EOF) {
// If we have R_EOF, we need to immediately quit.
// There's no need to go through the input functions.
return R_EOF;
} else {
input_common_next_ch(c);
input_mapping_execute_matching_or_generic(allow_commands);