diff --git a/src/help.c b/src/help.c index b497f548..dfcd3ac1 100644 --- a/src/help.c +++ b/src/help.c @@ -462,6 +462,7 @@ void show_help(void) #ifndef NANO_TINY openfile->mark = NULL; + spotlighted = FALSE; hide_cursor = FALSE; if (bracketed_paste || kbinput == BRACKETED_PASTE_MARKER) { diff --git a/src/nano.c b/src/nano.c index da195ed1..4dea8ae4 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2539,6 +2539,9 @@ int main(int argc, char **argv) errno = 0; focusing = TRUE; + if (spotlighted) + refresh_needed = TRUE; + spotlighted = FALSE; /* Forget any earlier cursor position at the prompt. */ put_cursor_at_end_of_answer(); diff --git a/src/search.c b/src/search.c index d4f2c0e0..61fd5cca 100644 --- a/src/search.c +++ b/src/search.c @@ -323,13 +323,13 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, *match_len = found_len; #ifndef NANO_TINY - if (modus == JUSTFIND && ISSET(MARK_MATCH) && (!openfile->mark || openfile->softmark)) { - openfile->mark = line; - openfile->mark_x = found_x + found_len; - openfile->softmark = TRUE; + if (modus == JUSTFIND && ISSET(MARK_MATCH) && !openfile->mark) { + spotlighted = TRUE; + light_from_col = xplustabs(); + light_to_col = wideness(openfile->current->data, openfile->current_x + found_len); if (!ISSET(SHOW_CURSOR)) hide_cursor = TRUE; - shift_held = TRUE; + refresh_needed = TRUE; } #endif diff --git a/src/winio.c b/src/winio.c index a16f8116..1312038c 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2842,7 +2842,7 @@ int update_line(linestruct *line, size_t index) wattroff(edit, hilite_attribute); } - if (spotlighted && line == openfile->current && !inhelp) + if (spotlighted && line == openfile->current) spotlight(light_from_col, light_to_col); return 1; @@ -2903,7 +2903,7 @@ int update_softwrapped_line(linestruct *line) from_col = to_col; } - if (spotlighted && line == openfile->current && !inhelp) + if (spotlighted && line == openfile->current) spotlight_softwrapped(light_from_col, light_to_col); return (row - starting_row);