patch 9.1.1535: the maximum search count uses hard-coded value 99

Problem:  The maximum search count uses a hard-coded value of 99
          (Andres Monge, Joschua Kesper)
Solution: Make it configurable using the 'maxsearchcount' option.

related: #8855
fixes: #17527
closes: #17695

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2025-07-10 20:34:41 +02:00
parent bda2e4eb16
commit b7b7fa04bf
14 changed files with 259 additions and 45 deletions

View File

@ -4138,6 +4138,29 @@ did_set_scrollbind(optset_T *args UNUSED)
return NULL;
}
/*
* Process the new 'maxsearchcount' option value.
*/
char *
did_set_maxsearchcount(optset_T *args UNUSED)
{
char *errmsg = NULL;
// if you increase this, also increase SEARCH_STAT_BUF_LEN in search.c
#define MAX_SEARCH_COUNT 9999
if (p_msc <= 0)
errmsg = e_argument_must_be_positive;
else if (p_msc > MAX_SEARCH_COUNT)
errmsg = e_invalid_argument;
if (errmsg != NULL)
p_msc = 99;
return errmsg;
#undef MAX_SEARCH_COUNT
}
#if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
/*
* Process the updated 'shellslash' option value.