vim-patch:9.1.1538: tests: string options in gen_opt_test.vim not fully sorted (#34891)

Problem:  tests: string options in gen_opt_test.vim aren't fully sorted.
Solution: Sort the string options alphabetically.  Also make description
          of 'maxsearchcount' start with lower-case for consistency with
          other options, update documentation for searchcount().

closes: vim/vim#17720

7306e8fcdb
This commit is contained in:
zeertzjq
2025-07-12 06:56:43 +08:00
committed by GitHub
parent 7f5b5d34cf
commit d4074b812d
6 changed files with 32 additions and 29 deletions

View File

@ -8455,11 +8455,12 @@ 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 999.
If it exceeded 999 the result must be max count + 1 (1000). If
you want to get correct information, specify `recompute: 1`: >vim
wrong information because of 'maxsearchcount'.
If the count exceeded 'maxsearchcount', the result must be
'maxsearchcount' + 1. If you want to get correct information,
specify `recompute: 1`: >vim
" result == maxcount + 1 (1000) when many matches
" result == 'maxsearchcount' + 1 when many matches
let result = searchcount(#{recompute: 0})
" Below returns correct result (recompute defaults
@ -8546,7 +8547,7 @@ searchcount([{options}]) *searchcount()*
result. if search exceeded
total count, "total" value
becomes `maxcount + 1`
(default: 0)
(default: 'maxsearchcount')
pos |List| `[lnum, col, off]` value
when recomputing the result.
this changes "current" result

View File

@ -7698,11 +7698,12 @@ 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 999.
--- If it exceeded 999 the result must be max count + 1 (1000). If
--- you want to get correct information, specify `recompute: 1`: >vim
--- wrong information because of 'maxsearchcount'.
--- If the count exceeded 'maxsearchcount', the result must be
--- 'maxsearchcount' + 1. If you want to get correct information,
--- specify `recompute: 1`: >vim
---
--- " result == maxcount + 1 (1000) when many matches
--- " result == 'maxsearchcount' + 1 when many matches
--- let result = searchcount(#{recompute: 0})
---
--- " Below returns correct result (recompute defaults
@ -7789,7 +7790,7 @@ function vim.fn.search(pattern, flags, stopline, timeout, skip) end
--- result. if search exceeded
--- total count, "total" value
--- becomes `maxcount + 1`
--- (default: 0)
--- (default: 'maxsearchcount')
--- pos |List| `[lnum, col, off]` value
--- when recomputing the result.
--- this changes "current" result

View File

@ -261,7 +261,7 @@ call <SID>AddOption("ignorecase", gettext("ignore case when using a search patte
call <SID>BinOptionG("ic", &ic)
call <SID>AddOption("smartcase", gettext("override 'ignorecase' when pattern has upper case characters"))
call <SID>BinOptionG("scs", &scs)
call <SID>AddOption("maxsearchcount", gettext("Maximum number for the search count feature"))
call <SID>AddOption("maxsearchcount", gettext("maximum number for the search count feature"))
call <SID>OptionG("msc", &msc)
call <SID>AddOption("casemap", gettext("what method to use for changing case of letters"))
call <SID>OptionG("cmp", &cmp)