diff --git a/src/nano.c b/src/nano.c index abc49174..fe226849 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2524,11 +2524,6 @@ int main(int argc, char **argv) } else if (LINES > 1 || lastmessage == VACUUM) edit_refresh(); -#ifndef NANO_TINY - /* Let the next keystroke cancel the highlighting of a search match. */ - refresh_needed = spotlighted; - spotlighted = FALSE; -#endif errno = 0; focusing = TRUE; diff --git a/src/winio.c b/src/winio.c index 57e4043a..7a5f4c2c 100644 --- a/src/winio.c +++ b/src/winio.c @@ -193,8 +193,9 @@ void read_keys_from(WINDOW *win) curs_set(1); #ifndef NANO_TINY - if (currmenu == MMAIN && (ISSET(MINIBAR) || LINES == 1) && lastmessage > HUSH && - lastmessage != INFO && lastmessage < ALERT) { + if (currmenu == MMAIN && (spotlighted || ((ISSET(MINIBAR) || LINES == 1) && + lastmessage > HUSH && + lastmessage != INFO && lastmessage < ALERT))) { timed = TRUE; halfdelay(ISSET(QUICK_BLANK) ? 8 : 15); disable_kb_interrupt(); @@ -216,11 +217,13 @@ void read_keys_from(WINDOW *win) raw(); if (input == ERR) { - if (LINES == 1) { + if (spotlighted || LINES == 1) { lastmessage = VACUUM; + spotlighted = FALSE; edit_refresh(); curs_set(1); - } else + } + if (ISSET(MINIBAR) && LINES > 1) minibar(); as_an_at = TRUE; place_the_cursor(); @@ -245,6 +248,10 @@ void read_keys_from(WINDOW *win) key_buffer_len = 1; #ifndef NANO_TINY + /* Cancel the highlighting of a search match, if there still is one. */ + refresh_needed |= spotlighted; + spotlighted = FALSE; + /* If we got a SIGWINCH, get out as the win argument is no longer valid. */ if (input == KEY_WINCH) return;