diff --git a/src/input.cpp b/src/input.cpp index f344694f3..4b183b80c 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -263,7 +263,7 @@ static maybe_t interrupt_handler() { return char_event_t{vintr}; } - return char_event_t{R_NULL}; + return char_event_t{char_event_type_t::check_exit}; } static std::atomic input_initialized{false}; diff --git a/src/input_common.cpp b/src/input_common.cpp index d71bbb91f..29826459a 100644 --- a/src/input_common.cpp +++ b/src/input_common.cpp @@ -197,8 +197,6 @@ char_event_t input_common_readch() { } wint_t b = evt.get_char(); - if (b >= R_NULL && b < R_END_INPUT_FUNCTIONS) return b; - if (MB_CUR_MAX == 1) { return b; // single-byte locale, all values are legal } diff --git a/src/input_common.h b/src/input_common.h index 51aa41f60..85db7b5c6 100644 --- a/src/input_common.h +++ b/src/input_common.h @@ -11,9 +11,8 @@ enum { R_MIN = INPUT_COMMON_BASE, - R_NULL = R_MIN, - R_BEGINNING_OF_LINE, + R_BEGINNING_OF_LINE = R_MIN, R_END_OF_LINE, R_FORWARD_CHAR, R_BACKWARD_CHAR, diff --git a/src/reader.cpp b/src/reader.cpp index 19c455b44..b911f2a2f 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1044,7 +1044,6 @@ static bool command_ends_paging(wchar_t c, bool focused_on_search_field) { case R_FORWARD_CHAR: case R_UP_LINE: case R_DOWN_LINE: - case R_NULL: case R_REPAINT: case R_SUPPRESS_AUTOSUGGESTION: case R_BEGINNING_OF_HISTORY: @@ -2502,7 +2501,8 @@ maybe_t reader_data_t::readline(int nchars) { } if (!event_needing_handling || event_needing_handling->is_check_exit()) { - event_needing_handling = R_NULL; + repaint_if_needed(); + continue; } else if (event_needing_handling->is_eof()) { reader_force_exit(); continue; @@ -2562,9 +2562,6 @@ maybe_t reader_data_t::readline(int nchars) { reader_repaint_needed(); break; } - case R_NULL: { - break; - } case R_CANCEL: { // The only thing we can cancel right now is paging, which we handled up above. break; @@ -3267,7 +3264,7 @@ maybe_t reader_data_t::readline(int nchars) { if ((c != R_HISTORY_SEARCH_BACKWARD) && (c != R_HISTORY_SEARCH_FORWARD) && (c != R_HISTORY_TOKEN_SEARCH_BACKWARD) && (c != R_HISTORY_TOKEN_SEARCH_FORWARD) && - (c != R_NULL) && (c != R_REPAINT) && (c != R_FORCE_REPAINT)) { + (c != R_REPAINT) && (c != R_FORCE_REPAINT)) { history_search.reset(); }