From ac3d3c399cbf6973e7be0a3d824ab6eab9dd742a Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 28 Jan 2019 18:10:41 +0100 Subject: [PATCH] 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. --- src/input.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/input.cpp b/src/input.cpp index 2fe26049d..f62c11f32 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -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);