diff --git a/src/definitions.h b/src/definitions.h index 51dbe5cb..019fbf48 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -343,7 +343,8 @@ enum { BOOKSTYLE, STATEFLAGS, USE_MAGIC, - MINIBAR + MINIBAR, + MARK_MATCH }; /* Structure types. */ diff --git a/src/nano.c b/src/nano.c index 5597af8f..cb20514e 100644 --- a/src/nano.c +++ b/src/nano.c @@ -641,6 +641,7 @@ void usage(void) print_opt("-z", "--suspendable", N_("Enable suspension")); #ifndef NANO_TINY print_opt("-%", "--stateflags", N_("Show some states on the title bar")); + print_opt("-^", "--markmatch", N_("Select the match of a search")); print_opt("-_", "--minibar", N_("Show bar at bottom with some state info")); #endif #ifdef HAVE_LIBMAGIC @@ -1759,6 +1760,7 @@ int main(int argc, char **argv) {"unix", 0, NULL, 'u'}, {"afterends", 0, NULL, 'y'}, {"stateflags", 0, NULL, '%'}, + {"markmatch", 0, NULL, '^'}, #endif #ifdef HAVE_LIBMAGIC {"magic", 0, NULL, '!'}, @@ -1813,7 +1815,7 @@ int main(int argc, char **argv) SET(RESTRICTED); while ((optchr = getopt_long(argc, argv, "ABC:DEFGHIJ:KLMNOPQ:RST:UVWX:Y:Z" - "abcdef:ghijklmno:pqr:s:tuvwxyz$_%!", long_options, NULL)) != -1) { + "abcdef:ghijklmno:pqr:s:tuvwxyz$%^_!", long_options, NULL)) != -1) { switch (optchr) { #ifndef NANO_TINY case 'A': @@ -2056,6 +2058,9 @@ int main(int argc, char **argv) case '%': SET(STATEFLAGS); break; + case '^': + SET(MARK_MATCH); + break; #endif #ifdef HAVE_LIBMAGIC case '!': diff --git a/src/rcfile.c b/src/rcfile.c index d14d9994..f7a58397 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -109,6 +109,7 @@ static const rcoption rcopts[] = { {"indicator", INDICATOR}, {"jumpyscrolling", JUMPY_SCROLLING}, {"locking", LOCKING}, + {"markmatch", MARK_MATCH}, {"matchbrackets", 0}, {"minibar", MINIBAR}, {"noconvert", NO_CONVERT}, diff --git a/src/search.c b/src/search.c index 3e3e95a9..40350bba 100644 --- a/src/search.c +++ b/src/search.c @@ -323,7 +323,7 @@ int findnextstr(const char *needle, bool whole_word_only, int modus, *match_len = found_len; #ifndef NANO_TINY - if (modus == JUSTFIND && (!openfile->mark || openfile->softmark)) { + if (modus == JUSTFIND && ISSET(MARK_MATCH) && (!openfile->mark || openfile->softmark)) { openfile->mark = line; openfile->mark_x = found_x + found_len; openfile->softmark = TRUE;