search: automatically drop the spotlighting after a few moments
Even though I know that spotlighted text is not selected, I still regularly think for a fleeting instant that the spotlighted text can be cut with a ^K. Mitigate this by dropping the spotlighting after 1.5 seconds (or 0.8 seconds when using --quick).master
parent
092c62ccb8
commit
3f340836a6
|
@ -2524,11 +2524,6 @@ int main(int argc, char **argv)
|
||||||
} else if (LINES > 1 || lastmessage == VACUUM)
|
} else if (LINES > 1 || lastmessage == VACUUM)
|
||||||
edit_refresh();
|
edit_refresh();
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
|
||||||
/* Let the next keystroke cancel the highlighting of a search match. */
|
|
||||||
refresh_needed = spotlighted;
|
|
||||||
spotlighted = FALSE;
|
|
||||||
#endif
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
focusing = TRUE;
|
focusing = TRUE;
|
||||||
|
|
||||||
|
|
15
src/winio.c
15
src/winio.c
|
@ -193,8 +193,9 @@ void read_keys_from(WINDOW *win)
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (currmenu == MMAIN && (ISSET(MINIBAR) || LINES == 1) && lastmessage > HUSH &&
|
if (currmenu == MMAIN && (spotlighted || ((ISSET(MINIBAR) || LINES == 1) &&
|
||||||
lastmessage != INFO && lastmessage < ALERT) {
|
lastmessage > HUSH &&
|
||||||
|
lastmessage != INFO && lastmessage < ALERT))) {
|
||||||
timed = TRUE;
|
timed = TRUE;
|
||||||
halfdelay(ISSET(QUICK_BLANK) ? 8 : 15);
|
halfdelay(ISSET(QUICK_BLANK) ? 8 : 15);
|
||||||
disable_kb_interrupt();
|
disable_kb_interrupt();
|
||||||
|
@ -216,11 +217,13 @@ void read_keys_from(WINDOW *win)
|
||||||
raw();
|
raw();
|
||||||
|
|
||||||
if (input == ERR) {
|
if (input == ERR) {
|
||||||
if (LINES == 1) {
|
if (spotlighted || LINES == 1) {
|
||||||
lastmessage = VACUUM;
|
lastmessage = VACUUM;
|
||||||
|
spotlighted = FALSE;
|
||||||
edit_refresh();
|
edit_refresh();
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
} else
|
}
|
||||||
|
if (ISSET(MINIBAR) && LINES > 1)
|
||||||
minibar();
|
minibar();
|
||||||
as_an_at = TRUE;
|
as_an_at = TRUE;
|
||||||
place_the_cursor();
|
place_the_cursor();
|
||||||
|
@ -245,6 +248,10 @@ void read_keys_from(WINDOW *win)
|
||||||
key_buffer_len = 1;
|
key_buffer_len = 1;
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#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 we got a SIGWINCH, get out as the win argument is no longer valid. */
|
||||||
if (input == KEY_WINCH)
|
if (input == KEY_WINCH)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue