Repository: neovim/neovim
Pull request #33937: feat(search): increase `MAX_COUNT` to 999
Author: login: clason
Created: 2025-05-10T10:29:37Z | Merged: 2025-05-24T08:55:43Z

Problem: "99 searchcount ought to be enough for anyone."

Solution: Increase `SEARCH_STAT_DEF_MAX_COUNT` to 999, which I'm sure
will suffice for the next twenty years.

Closes #33748.


Linked issue #33748: Increase max search count number SEARCH_STAT_DEF_MAX_COUNT to a number more than 99
### Problem

There was a two separate pull requests that tried to achieve this and both were abandoned/closed.[1](https://github.com/neovim/neovim/pull/22662) &nbsp; [2](https://github.com/neovim/neovim/pull/18924).   
For this issue to be tracked properly and to be seen by more people, I'd like to open this issue.  

I lack the C programming skills to produce a PR, but maybe there's a people who interested in this and want to submit a PR.

### Expected behavior

Currently if we have more than 99 found items through a search in neovim, it limits both the current search item (A) and total found items to `SEARCH_STAT_DEF_MAX_COUNT`=99.

A) 
![Image](https://github.com/user-attachments/assets/ae709e86-862b-486b-a8dc-c9bf7a2b9609)

B) 

![Image](https://github.com/user-attachments/assets/d9f77178-7cb3-428d-9c6a-af110b27f59f)

I think it'd be great for folks who want to search through a larger files to have limit more than 99. Maybe 999 is most sane option as discussed [here](https://github.com/neovim/neovim/pull/18924#issuecomment-1152899069)
Linked issue comments: user: login: swivelmargarita
created_at: 2025-05-24T14:13:56Z
body: Thanks! @clason @seandewar 
author_association: NONE

Diff:
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 3ff4406eed0c8d..22bb0a728f9541 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -8415,11 +8415,11 @@ searchcount([{options}])                                         *searchcount()*
 
 		To get the last search count when |n| or |N| was pressed, call
 		this function with `recompute: 0` . This sometimes returns
-		wrong information because |n| and |N|'s maximum count is 99.
-		If it exceeded 99 the result must be max count + 1 (100). If
+		wrong information because |n| and |N|'s maximum count is 999.
+		If it exceeded 999 the result must be max count + 1 (1000). If
 		you want to get correct information, specify `recompute: 1`: >vim
 
-			" result == maxcount + 1 (100) when many matches
+			" result == maxcount + 1 (1000) when many matches
 			let result = searchcount(#{recompute: 0})
 
 			" Below returns correct result (recompute defaults
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 940bd94603b915..4b18f42ba258ee 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -227,6 +227,7 @@ These existing features changed their behavior.
 • 'spellfile' location defaults to `stdpath("data").."/site/spell/"` instead of
   the first writable directory in 'runtimepath'.
 • |vim.version.range()| doesn't exclude `to` if it is equal to `from`.
+• |searchcount()|'s maximal value is raised from 99 to 999.
 
 ==============================================================================
 REMOVED FEATURES                                                 *news-removed*
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 9f77836ea883b7..f83a1b20931a23 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -327,6 +327,7 @@ Functions:
 - |matchadd()| can be called before highlight group is defined
 - |tempname()| tries to recover if the Nvim |tempdir| disappears.
 - |writefile()| with "p" flag creates parent directories.
+- |searchcount()|'s maximal value is raised from 99 to 999.
 
 Highlight groups:
 - |highlight-blend| controls blend level for a highlight group
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index f07ea9a20f0cbf..c4be7e8ea4d62b 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -7664,11 +7664,11 @@ function vim.fn.search(pattern, flags, stopline, timeout, skip) end
 ---
 --- To get the last search count when |n| or |N| was pressed, call
 --- this function with `recompute: 0` . This sometimes returns
---- wrong information because |n| and |N|'s maximum count is 99.
---- If it exceeded 99 the result must be max count + 1 (100). If
+--- wrong information because |n| and |N|'s maximum count is 999.
+--- If it exceeded 999 the result must be max count + 1 (1000). If
 --- you want to get correct information, specify `recompute: 1`: >vim
 ---
----   " result == maxcount + 1 (100) when many matches
+---   " result == maxcount + 1 (1000) when many matches
 ---   let result = searchcount(#{recompute: 0})
 ---
 ---   " Below returns correct result (recompute defaults
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index cc1f85b614ed3d..2cc926888db21c 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -9319,11 +9319,11 @@ M.funcs = {
 
       To get the last search count when |n| or |N| was pressed, call
       this function with `recompute: 0` . This sometimes returns
-      wrong information because |n| and |N|'s maximum count is 99.
-      If it exceeded 99 the result must be max count + 1 (100). If
+      wrong information because |n| and |N|'s maximum count is 999.
+      If it exceeded 999 the result must be max count + 1 (1000). If
       you want to get correct information, specify `recompute: 1`: >vim
 
-      	" result == maxcount + 1 (100) when many matches
+      	" result == maxcount + 1 (1000) when many matches
       	let result = searchcount(#{recompute: 0})
 
       	" Below returns correct result (recompute defaults
diff --git a/src/nvim/search.h b/src/nvim/search.h
index d92f3c90024eba..96c8366adef7ed 100644
--- a/src/nvim/search.h
+++ b/src/nvim/search.h
@@ -63,8 +63,8 @@ enum {
 
 // Values for searchcount()
 enum { SEARCH_STAT_DEF_TIMEOUT = 40, };
-enum { SEARCH_STAT_DEF_MAX_COUNT = 99, };
-enum { SEARCH_STAT_BUF_LEN = 12, };
+enum { SEARCH_STAT_DEF_MAX_COUNT = 999, };
+enum { SEARCH_STAT_BUF_LEN = 14, };
 
 enum {
   /// Maximum number of characters that can be fuzzy matched
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 6c24483c641b16..aaac1c1a199579 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -731,7 +731,7 @@ describe('ui/ext_messages', function()
     ]],
       cmdline = { { abort = false } },
       messages = {
-        { content = { { '/line      W [1/2]' } }, kind = 'search_count' },
+        { content = { { '/line        W [1/2]' } }, kind = 'search_count' },
       },
     }
 
@@ -743,7 +743,7 @@ describe('ui/ext_messages', function()
       {1:~                        }|*3
     ]],
       messages = {
-        { content = { { '/line        [2/2]' } }, kind = 'search_count' },
+        { content = { { '/line          [2/2]' } }, kind = 'search_count' },
       },
     }
   end)
diff --git a/test/old/testdir/test_search_stat.vim b/test/old/testdir/test_search_stat.vim
index c8e055d7db14ac..e74d2ed5ab4adb 100644
--- a/test/old/testdir/test_search_stat.vim
+++ b/test/old/testdir/test_search_stat.vim
@@ -16,27 +16,27 @@ func Test_search_stat()
   " but setting @/ should also work (even 'n' nor 'N' was executed)
   " recompute the count when the last position is different.
   call assert_equal(
-    \ #{current: 1, exact_match: 1, total: 40, incomplete: 0, maxcount: 99},
+    \ #{current: 1, exact_match: 1, total: 40, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'foo'}))
   call assert_equal(
-    \ #{current: 0, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
+    \ #{current: 0, exact_match: 0, total: 10, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'fooooobar'}))
   call assert_equal(
-    \ #{current: 0, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
+    \ #{current: 0, exact_match: 0, total: 10, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'fooooobar', pos: [2, 1, 0]}))
   call assert_equal(
-    \ #{current: 1, exact_match: 1, total: 10, incomplete: 0, maxcount: 99},
+    \ #{current: 1, exact_match: 1, total: 10, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'fooooobar', pos: [3, 1, 0]}))
   " on last char of match
   call assert_equal(
-    \ #{current: 1, exact_match: 1, total: 10, incomplete: 0, maxcount: 99},
+    \ #{current: 1, exact_match: 1, total: 10, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'fooooobar', pos: [3, 9, 0]}))
   " on char after match
   call assert_equal(
-    \ #{current: 1, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
+    \ #{current: 1, exact_match: 0, total: 10, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'fooooobar', pos: [3, 10, 0]}))
   call assert_equal(
-    \ #{current: 1, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
+    \ #{current: 1, exact_match: 0, total: 10, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'fooooobar', pos: [4, 1, 0]}))
   call assert_equal(
     \ #{current: 1, exact_match: 0, total: 2, incomplete: 2, maxcount: 1},
@@ -53,7 +53,7 @@ func Test_search_stat()
   let pat = escape(@/, '()*?'). '\s\+'
   call assert_match(pat .. stat, g:a)
   call assert_equal(
-    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: 0}))
   " didn't get added to message history
   call assert_equal(messages_before, execute('messages'))
@@ -64,7 +64,7 @@ func Test_search_stat()
   let stat = '\[50/50\]'
   call assert_match(pat .. stat, g:a)
   call assert_equal(
-    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: 0}))
 
   " No search stat
@@ -75,53 +75,65 @@ func Test_search_stat()
   call assert_notmatch(pat .. stat, g:a)
   " n does not update search stat
   call assert_equal(
-    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: 0}))
   call assert_equal(
-    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: v:true}))
   set shortmess-=S
 
+  " Nvim: max search count is 999; append more lines to surpass it.
+  " Create a new undo block so we can revert the change later.
+  " Also allow "[?/??]" in case of timeouts from the increased max, but set a
+  " larger timeout for the recomputing searchcount()s.
+  let &l:undolevels = &l:undolevels
+  call append(0, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 99))
+
   " Many matches
   call cursor(line('$')-2, 1)
   let @/ = '.'
   let pat = escape(@/, '()*?'). '\s\+'
   let g:a = execute(':unsilent :norm! n')
-  let stat = '\[>99/>99\]'
+  let stat = '\[\%(>999/>999\|?/??\)\]'
   call assert_match(pat .. stat, g:a)
   call assert_equal(
-    \ #{current: 100, exact_match: 0, total: 100, incomplete: 2, maxcount: 99},
-    \ searchcount(#{recompute: 0}))
+    \ #{current: 1000, exact_match: 0, total: 1000, incomplete: 2, maxcount: 999},
+    "\ Nvim: must recompute if the previous search timed out.
+    \ searchcount(#{recompute: (g:a =~# pat .. '\[?/??\]'), timeout: 500}))
   call assert_equal(
-    \ #{current: 272, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
-    \ searchcount(#{recompute: v:true, maxcount: 0, timeout: 200}))
+    \ #{current: 3044, exact_match: 1, total: 3052, incomplete: 0, maxcount: 0},
+    \ searchcount(#{recompute: v:true, maxcount: 0, timeout: 500}))
   call assert_equal(
-    \ #{current: 1, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
-    \ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 200}))
+    \ #{current: 1, exact_match: 1, total: 3052, incomplete: 0, maxcount: 0},
+    \ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 500}))
   call cursor(line('$'), 1)
   let g:a = execute(':unsilent :norm! n')
-  let stat = 'W \[1/>99\]'
+  let stat = 'W \[\%(1/>999\|?/??\)\]'
   call assert_match(pat .. stat, g:a)
   call assert_equal(
-    \ #{current: 1, exact_match: 1, total: 100, incomplete: 2, maxcount: 99},
-    \ searchcount(#{recompute: 0}))
+    \ #{current: 1, exact_match: 1, total: 1000, incomplete: 2, maxcount: 999},
+    "\ Nvim: must recompute if the previous search timed out.
+    \ searchcount(#{recompute: (g:a =~# pat .. '\[?/??\]'), timeout: 500}))
   call assert_equal(
-    \ #{current: 1, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
-    \ searchcount(#{recompute: 1, maxcount: 0, timeout: 200}))
+    \ #{current: 1, exact_match: 1, total: 3052, incomplete: 0, maxcount: 0},
+    \ searchcount(#{recompute: 1, maxcount: 0, timeout: 500}))
   call assert_equal(
-    \ #{current: 271, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
-    \ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 200}))
+    \ #{current: 3043, exact_match: 1, total: 3052, incomplete: 0, maxcount: 0},
+    \ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 500}))
 
   " Many matches
   call cursor(1, 1)
   let g:a = execute(':unsilent :norm! n')
-  let stat = '\[2/>99\]'
+  let stat = '\[\%(2/>999\|?/??\)\]'
   call assert_match(pat .. stat, g:a)
   call cursor(1, 1)
   let g:a = execute(':unsilent :norm! N')
-  let stat = 'W \[>99/>99\]'
+  let stat = 'W \[\%(>999/>999\|?/??\)\]'
   call assert_match(pat .. stat, g:a)
 
+  " Nvim: undo the extra lines.
+  undo
+
   " right-left
   if exists("+rightleft")
     set rl


Reviews:
user: login: clason
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-11T15:52:54Z
user: login: seandewar
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-11T15:54:08Z
user: login: clason
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-11T15:55:34Z
user: login: seandewar
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-11T16:01:56Z
user: login: clason
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-11T16:03:15Z
user: login: seandewar
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-11T17:51:38Z
user: login: lewis6991
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-23T09:39:48Z
user: login: justinmk
body: vim_diff.txt ?
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-23T14:07:22Z

Review comments:
diff_hunk: @@ -75,53 +75,61 @@ func Test_search_stat()
   call assert_notmatch(pat .. stat, g:a)
   " n does not update search stat
   call assert_equal(
-    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: 0}))
   call assert_equal(
-    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: v:true}))
   set shortmess-=S
 
+  " Nvim: max search count is 999; append more lines to surpass it.
+  " Create an new undo block so we can revert the change later.
path: test/old/testdir/test_search_stat.vim
user: login: clason
body: ```suggestion
  " Create a new undo block so we can revert the change later.
```
created_at: 2025-05-11T15:52:54Z
author_association: MEMBER
diff_hunk: @@ -75,53 +75,61 @@ func Test_search_stat()
   call assert_notmatch(pat .. stat, g:a)
   " n does not update search stat
   call assert_equal(
-    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: 0}))
   call assert_equal(
-    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: v:true}))
   set shortmess-=S
 
+  " Nvim: max search count is 999; append more lines to surpass it.
+  " Create an new undo block so we can revert the change later.
path: test/old/testdir/test_search_stat.vim
user: login: seandewar
body: me good at write englandish :troll::pencil2: 
created_at: 2025-05-11T15:54:08Z
author_association: MEMBER
diff_hunk: @@ -75,53 +75,61 @@ func Test_search_stat()
   call assert_notmatch(pat .. stat, g:a)
   " n does not update search stat
   call assert_equal(
-    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: 0}))
   call assert_equal(
-    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: v:true}))
   set shortmess-=S
 
+  " Nvim: max search count is 999; append more lines to surpass it.
+  " Create an new undo block so we can revert the change later.
path: test/old/testdir/test_search_stat.vim
user: login: clason
body: cuz too good at write vimscript 🤗 
created_at: 2025-05-11T15:55:34Z
author_association: MEMBER
diff_hunk: @@ -75,53 +75,61 @@ func Test_search_stat()
   call assert_notmatch(pat .. stat, g:a)
   " n does not update search stat
   call assert_equal(
-    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: 0}))
   call assert_equal(
-    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: v:true}))
   set shortmess-=S
 
+  " Nvim: max search count is 999; append more lines to surpass it.
+  " Create an new undo block so we can revert the change later.
path: test/old/testdir/test_search_stat.vim
user: login: seandewar
body: now time to fix the functionaltests :heart_eyes: 
created_at: 2025-05-11T16:01:56Z
author_association: MEMBER
diff_hunk: @@ -75,53 +75,61 @@ func Test_search_stat()
   call assert_notmatch(pat .. stat, g:a)
   " n does not update search stat
   call assert_equal(
-    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: 0}))
   call assert_equal(
-    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
+    \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 999},
     \ searchcount(#{recompute: v:true}))
   set shortmess-=S
 
+  " Nvim: max search count is 999; append more lines to surpass it.
+  " Create an new undo block so we can revert the change later.
path: test/old/testdir/test_search_stat.vim
user: login: clason
body: Ah, the joy of hardcoded screen tests...
created_at: 2025-05-11T16:03:15Z
author_association: MEMBER

PR comments:
user: login: clason
created_at: 2025-05-10T10:38:09Z
body: I'll probably need help adjusting the `search_stat` tests that check for `>99`.
author_association: MEMBER
user: login: seandewar
created_at: 2025-05-11T16:21:05Z
body: ```
command line..script /home/runner/work/neovim/neovim/test/old/testdir/runtest.vim[593]..function RunTheTest[57]..Test_search_stat line 90: Pattern '.\\s\\+\\[>999/>999\\]' does not match '\n/.\[  occurs 76 times]\n\n/.\[  occurs 70 times][?/??]'
```

Lol, looks like the ASAN job is so slow that it times out on the search :innocent:
author_association: MEMBER
user: login: swivelmargarita
created_at: 2025-05-13T10:47:06Z
body: I also tried to make the old tests work, but gave up when I got to the last couple test cases.

I don't know what policy you guys have about updating(not fixing but improving upon) the old tests, so I apologize if it is out of place

Do you guys think here: https://github.com/neovim/neovim/pull/33937/files#diff-69c48a405c43c1fd0c8d7b51be1810692e2933f9fd7a1be377cbca5d7613d862R9

Instead of creating a 50 line dummy text file, maybe increasing it to, say 500, would be better?
I think it is inline with the change we're making: since we are increasing the max count, increase the test file


Here's what I mean more or less(from my local draft branch)

```diff 
diff --git i/test/old/testdir/test_search_stat.vim w/test/old/testdir/test_search_stat.vim
index 7c8ce2345f..da1b183cee 100644
--- i/test/old/testdir/test_search_stat.vim
+++ w/test/old/testdir/test_search_stat.vim
@@ -1,49 +1,49 @@
 " Tests for search_stats, when "S" is not in 'shortmess'
 
 source check.vim
 source screendump.vim
 
 func Test_search_stat()
   new
   set shortmess-=S
-  " Append 50 lines with text to search for, "foobar" appears 20 times
-  call append(0, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 10))
+  " Append 500 lines with text to search for, "foobar" appears 20 times
+  call append(0, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 100))
 
   call cursor(1, 1)
 
   " searchcount() returns an empty dictionary when previous pattern was not set
   call assert_equal({}, searchcount(#{pattern: ''}))
   " but setting @/ should also work (even 'n' nor 'N' was executed)
   " recompute the count when the last position is different.
   call assert_equal(
-    \ #{current: 1, exact_match: 1, total: 40, incomplete: 0, maxcount: 999},
+    \ #{current: 1, exact_match: 1, total: 400, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'foo'}))
   call assert_equal(
-    \ #{current: 0, exact_match: 0, total: 10, incomplete: 0, maxcount: 999},
+    \ #{current: 0, exact_match: 0, total: 100, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'fooooobar'}))
   call assert_equal(
-    \ #{current: 0, exact_match: 0, total: 10, incomplete: 0, maxcount: 999},
+    \ #{current: 0, exact_match: 0, total: 100, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'fooooobar', pos: [2, 1, 0]}))
   call assert_equal(
-    \ #{current: 1, exact_match: 1, total: 10, incomplete: 0, maxcount: 999},
+    \ #{current: 1, exact_match: 1, total: 100, incomplete: 0, maxcount: 999},
     \ searchcount(#{pattern: 'fooooobar', pos: [3, 1, 0]}))
     
...

```
author_association: NONE
user: login: clason
created_at: 2025-05-13T11:15:19Z
body: PSA: This PR is ready and just waiting for more input _from core maintainers_ about whether the divergence from Vim is worth it. I'll squash and merge it once we have consensus.
author_association: MEMBER
user: login: seandewar
created_at: 2025-05-13T13:12:24Z
body: @swivelmargarita Tests are already passing. That test was adjusted [here](https://github.com/neovim/neovim/commit/2f73c564dcce57ca3e1de66aca27816566952fdd#diff-69c48a405c43c1fd0c8d7b51be1810692e2933f9fd7a1be377cbca5d7613d862R85).

The current CI failure is due to the fixup commit not being squashed yet while we wait for other reviews.
author_association: MEMBER
user: login: swivelmargarita
created_at: 2025-05-13T14:21:48Z
body: Sorry for polluting the PR with messages, I completely overlooked that part.

Thanks @seandewar 
author_association: NONE