From 6548846950598f9173f254fcdf31326aac02bb4f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 13 Mar 2023 20:55:31 +1100 Subject: Slight refactoring of bracketed paste feature Handle begin/end paste directly in paste csi, manage paste buffer out of get_char, filter Key::Invalid earlier. get_next_key returning Key::Invalid means there was some input but it could not be represented as a Key. An empty optional means there was no input at all. --- src/input_handler.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/input_handler.cc') diff --git a/src/input_handler.cc b/src/input_handler.cc index 877517e2..97db92c6 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -1750,8 +1750,7 @@ static bool is_valid(Key key) { constexpr Key::Modifiers valid_mods = (Key::Modifiers::Control | Key::Modifiers::Alt | Key::Modifiers::Shift); - return key != Key::Invalid and - ((key.modifiers & ~valid_mods) or key.key <= 0x10FFFF); + return ((key.modifiers & ~valid_mods) or key.key <= 0x10FFFF); } void InputHandler::handle_key(Key key) -- cgit v1.2.3