search: set the mark at the end of a found match so it gets highlighted
Not only does the match get highlighted (for better visibility), but this also allows deleting the match with a single keystroke (^K, or <Del> or <Bsp> when --zap is used) and then type something else. This https://savannah.gnu.org/bugs/?59655. Requested-by: Noam Sondak <noamso@gmail.com>master
parent
e353203010
commit
856a6ecde3
|
@ -322,6 +322,15 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
|
|||
if (match_len != NULL)
|
||||
*match_len = found_len;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (modus == JUSTFIND && (!openfile->mark || openfile->softmark)) {
|
||||
openfile->mark = line;
|
||||
openfile->mark_x = found_x + found_len;
|
||||
openfile->softmark = TRUE;
|
||||
shift_held = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Wipe the "Searching..." message and unsuppress cursor-position display. */
|
||||
if (feedback > 0) {
|
||||
wipe_statusbar();
|
||||
|
|
Loading…
Reference in New Issue