Problem: Cached searchcount() returns 'maxsearchcount' instead of the
requested maxcount.
Solution: return the remembered last_maxcount (glepnir)
closes: #20701
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
stat->cnt = cnt;
stat->exact_match = exact_match;
stat->incomplete = incomplete;
stat->cnt = cnt;
stat->exact_match = exact_match;
stat->incomplete = incomplete;
- stat->last_maxcount = p_msc;
+ stat->last_maxcount = last_maxcount;
return;
}
last_maxcount = maxcount;
return;
}
last_maxcount = maxcount;
call StopVimInTerminal(buf)
endfunc
call StopVimInTerminal(buf)
endfunc
+func Test_searchcount_maxcount_cached()
+ new
+ call setline(1, repeat(['foo'], 5))
+ set maxsearchcount=99
+ let @/ = 'foo'
+ call cursor(1, 1)
+ call searchcount(#{recompute: v:true, maxcount: 3})
+ let r = searchcount(#{recompute: v:false, maxcount: 3})
+ call assert_equal(3, r.maxcount)
+ set maxsearchcount&
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
static int included_patches[] =
{ /* Add new patch number below this line */