mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 12:51:23 +03:00
search: just highlight the found occurrence, instead of marking it
Requested-by: Peter Passchier <peter@passchier.net>
This commit is contained in:
parent
ade2fafbd3
commit
37717baeed
@ -461,7 +461,7 @@ void show_help(void)
|
||||
didfind = 0;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
openfile->mark = NULL;
|
||||
spotlighted = FALSE;
|
||||
hide_cursor = FALSE;
|
||||
|
||||
if (bracketed_paste || kbinput == BRACKETED_PASTE_MARKER) {
|
||||
|
@ -2540,6 +2540,11 @@ int main(int argc, char **argv)
|
||||
} else
|
||||
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;
|
||||
|
||||
|
@ -324,12 +324,12 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
|
||||
|
||||
#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;
|
||||
spotlighted = TRUE;
|
||||
light_from_col = xplustabs();
|
||||
light_to_col = wideness(line->data, found_x + found_len);
|
||||
if (!ISSET(SHOW_CURSOR))
|
||||
hide_cursor = TRUE;
|
||||
shift_held = TRUE;
|
||||
refresh_needed = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2854,7 +2854,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;
|
||||
@ -2915,7 +2915,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);
|
||||
|
Loading…
Reference in New Issue
Block a user