tests: string options in gen_opt_test.vim not fully sorted

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: #17720

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2025-07-11 19:17:07 +02:00
committed by Christian Brabandt
parent 41adebe572
commit 7306e8fcdb
5 changed files with 23 additions and 20 deletions

View File

@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2025 Jul 06 *builtin.txt* For Vim version 9.1. Last change: 2025 Jul 11
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -9378,11 +9378,12 @@ searchcount([{options}]) *searchcount()*
To get the last search count when |n| or |N| was pressed, call To get the last search count when |n| or |N| was pressed, call
this function with `recompute: 0` . This sometimes returns this function with `recompute: 0` . This sometimes returns
wrong information because |n| and |N|'s maximum count is 99. wrong information because of 'maxsearchcount'.
If it exceeded 99 the result must be max count + 1 (100). If If the count exceeded 'maxsearchcount', the result must be
you want to get correct information, specify `recompute: 1`: > 'maxsearchcount' + 1. If you want to get correct information,
specify `recompute: 1`: >
" result == maxcount + 1 (100) when many matches " result == 'maxsearchcount' + 1 when many matches
let result = searchcount(#{recompute: 0}) let result = searchcount(#{recompute: 0})
" Below returns correct result (recompute defaults " Below returns correct result (recompute defaults
@ -9469,7 +9470,7 @@ searchcount([{options}]) *searchcount()*
result. if search exceeded result. if search exceeded
total count, "total" value total count, "total" value
becomes `maxcount + 1` becomes `maxcount + 1`
(default: 99) (default: 'maxsearchcount')
pos |List| `[lnum, col, off]` value pos |List| `[lnum, col, off]` value
when recomputing the result. when recomputing the result.
this changes "current" result this changes "current" result

View File

@ -283,7 +283,7 @@ call <SID>AddOption("ignorecase", gettext("ignore case when using a search patte
call <SID>BinOptionG("ic", &ic) call <SID>BinOptionG("ic", &ic)
call <SID>AddOption("smartcase", gettext("override 'ignorecase' when pattern has upper case characters")) call <SID>AddOption("smartcase", gettext("override 'ignorecase' when pattern has upper case characters"))
call <SID>BinOptionG("scs", &scs) 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>OptionG("msc", &msc)
call <SID>AddOption("casemap", gettext("what method to use for changing case of letters")) call <SID>AddOption("casemap", gettext("what method to use for changing case of letters"))
call <SID>OptionG("cmp", &cmp) call <SID>OptionG("cmp", &cmp)

View File

@ -536,10 +536,10 @@ func Test_search_stat_option()
\ searchcount(#{recompute: 0})) \ searchcount(#{recompute: 0}))
call assert_equal( call assert_equal(
\ #{exact_match: 1, current: 27992, incomplete: 0, maxcount:0, total: 28000}, \ #{exact_match: 1, current: 27992, incomplete: 0, maxcount:0, total: 28000},
\ searchcount(#{recompute: v:true, maxcount: 0, timeout: 200})) \ searchcount(#{recompute: v:true, maxcount: 0, timeout: 500}))
call assert_equal( call assert_equal(
\ #{exact_match: 1, current: 1, incomplete: 0, maxcount: 0, total: 28000}, \ #{exact_match: 1, current: 1, incomplete: 0, maxcount: 0, total: 28000},
\ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 200})) \ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 500}))
call cursor(line('$'), 1) call cursor(line('$'), 1)
let g:a = execute(':unsilent :norm! n') let g:a = execute(':unsilent :norm! n')
let stat = 'W \[1/>999\]' let stat = 'W \[1/>999\]'
@ -549,10 +549,10 @@ func Test_search_stat_option()
\ searchcount(#{recompute: 0})) \ searchcount(#{recompute: 0}))
call assert_equal( call assert_equal(
\ #{current: 1, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0}, \ #{current: 1, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0},
\ searchcount(#{recompute: 1, maxcount: 0, timeout: 200})) \ searchcount(#{recompute: 1, maxcount: 0, timeout: 500}))
call assert_equal( call assert_equal(
\ #{current: 27991, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0}, \ #{current: 27991, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0},
\ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 200})) \ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 500}))
" Many matches " Many matches
call cursor(1, 1) call cursor(1, 1)

View File

@ -158,22 +158,22 @@ let test_values = {
\ 's', 's/tmp/dir\\\ with\\\ space/*', \ 's', 's/tmp/dir\\\ with\\\ space/*',
\ 'w,b,k/tmp/dir\\\ with\\\ space/*,s'], \ 'w,b,k/tmp/dir\\\ with\\\ space/*,s'],
\ ['xxx']], \ ['xxx']],
\ 'concealcursor': [['', 'n', 'v', 'i', 'c', 'nvic'], ['xxx']],
\ 'completeopt': [['', 'menu', 'menuone', 'longest', 'preview', 'popup',
\ 'popuphidden', 'noinsert', 'noselect', 'fuzzy', "preinsert", 'menu,longest'],
\ ['xxx', 'menu,,,longest,']],
\ 'completefuzzycollect': [['', 'keyword', 'files', 'whole_line', \ 'completefuzzycollect': [['', 'keyword', 'files', 'whole_line',
\ 'keyword,whole_line', 'files,whole_line', 'keyword,files,whole_line'], \ 'keyword,whole_line', 'files,whole_line', 'keyword,files,whole_line'],
\ ['xxx', 'keyword,,,whole_line,']], \ ['xxx', 'keyword,,,whole_line,']],
\ 'completeitemalign': [['abbr,kind,menu', 'menu,abbr,kind'], \ 'completeitemalign': [['abbr,kind,menu', 'menu,abbr,kind'],
\ ['', 'xxx', 'abbr', 'abbr,menu', 'abbr,menu,kind,abbr', \ ['', 'xxx', 'abbr', 'abbr,menu', 'abbr,menu,kind,abbr',
\ 'abbr1234,kind,menu']], \ 'abbr1234,kind,menu']],
\ 'completeopt': [['', 'menu', 'menuone', 'longest', 'preview', 'popup',
\ 'popuphidden', 'noinsert', 'noselect', 'fuzzy', "preinsert", 'menu,longest'],
\ ['xxx', 'menu,,,longest,']],
\ 'completepopup': [['', 'height:13', 'width:20', 'highlight:That', \ 'completepopup': [['', 'height:13', 'width:20', 'highlight:That',
\ 'align:item', 'align:menu', 'border:on', 'border:off', \ 'align:item', 'align:menu', 'border:on', 'border:off',
\ 'width:10,height:234,highlight:Mine'], \ 'width:10,height:234,highlight:Mine'],
\ ['xxx', 'xxx:99', 'height:yes', 'width:no', 'align:xxx', \ ['xxx', 'xxx:99', 'height:yes', 'width:no', 'align:xxx',
\ 'border:maybe', 'border:1', 'border:']], \ 'border:maybe', 'border:1', 'border:']],
\ 'completeslash': [['', 'slash', 'backslash'], ['xxx']], \ 'completeslash': [['', 'slash', 'backslash'], ['xxx']],
\ 'concealcursor': [['', 'n', 'v', 'i', 'c', 'nvic'], ['xxx']],
\ 'cryptmethod': [['', 'zip'], ['xxx']], \ 'cryptmethod': [['', 'zip'], ['xxx']],
\ 'cscopequickfix': [['', 's-', 'g-', 'd-', 'c-', 't-', 'e-', 'f-', 'i-', \ 'cscopequickfix': [['', 's-', 'g-', 'd-', 'c-', 't-', 'e-', 'f-', 'i-',
\ 'a-', 's-,c+,e0'], \ 'a-', 's-,c+,e0'],
@ -210,19 +210,19 @@ let test_values = {
\ 'stl:\ ,vert:\|,fold:\\,trunc:…,diff:x'], \ 'stl:\ ,vert:\|,fold:\\,trunc:…,diff:x'],
\ ['xxx', 'vert:', 'trunc:', "trunc:\b"]], \ ['xxx', 'vert:', 'trunc:', "trunc:\b"]],
\ 'foldclose': [['', 'all'], ['xxx']], \ 'foldclose': [['', 'all'], ['xxx']],
\ 'foldmarker': [['((,))'], ['', 'xxx', '{{{,']],
\ 'foldmethod': [['manual', 'indent', 'expr', 'marker', 'syntax', 'diff'], \ 'foldmethod': [['manual', 'indent', 'expr', 'marker', 'syntax', 'diff'],
\ ['', 'xxx', 'expr,diff']], \ ['', 'xxx', 'expr,diff']],
\ 'foldopen': [['', 'all', 'block', 'hor', 'insert', 'jump', 'mark', \ 'foldopen': [['', 'all', 'block', 'hor', 'insert', 'jump', 'mark',
\ 'percent', 'quickfix', 'search', 'tag', 'undo', 'hor,jump'], \ 'percent', 'quickfix', 'search', 'tag', 'undo', 'hor,jump'],
\ ['xxx']], \ ['xxx']],
\ 'foldmarker': [['((,))'], ['', 'xxx', '{{{,']],
\ 'formatoptions': [['', 't', 'c', 'r', 'o', '/', 'q', 'w', 'a', 'n', '2', \ 'formatoptions': [['', 't', 'c', 'r', 'o', '/', 'q', 'w', 'a', 'n', '2',
\ 'v', 'b', 'l', 'm', 'M', 'B', '1', ']', 'j', 'p', 'vt', 'v,t'], \ 'v', 'b', 'l', 'm', 'M', 'B', '1', ']', 'j', 'p', 'vt', 'v,t'],
\ ['xxx']], \ ['xxx']],
\ 'guicursor': [['', 'n:block-Cursor'], ['xxx']], \ 'guicursor': [['', 'n:block-Cursor'], ['xxx']],
\ 'guifont': [['', fontname], []], \ 'guifont': [['', fontname], []],
\ 'guifontwide': [['', fontname], []],
\ 'guifontset': [['', fontname], []], \ 'guifontset': [['', fontname], []],
\ 'guifontwide': [['', fontname], []],
\ 'guioptions': [['', '!', 'a', 'P', 'A', 'c', 'd', 'e', 'f', 'i', 'm', \ 'guioptions': [['', '!', 'a', 'P', 'A', 'c', 'd', 'e', 'f', 'i', 'm',
\ 'M', 'g', 't', 'T', 'r', 'R', 'l', 'L', 'b', 'h', 'v', 'p', 'F', \ 'M', 'g', 't', 'T', 'r', 'R', 'l', 'L', 'b', 'h', 'v', 'p', 'F',
\ 'k', '!abvR'], \ 'k', '!abvR'],
@ -230,9 +230,9 @@ let test_values = {
\ 'helplang': [['', 'de', 'de,it'], ['xxx']], \ 'helplang': [['', 'de', 'de,it'], ['xxx']],
\ 'highlight': [['', 'e:Error'], ['xxx']], \ 'highlight': [['', 'e:Error'], ['xxx']],
\ 'imactivatekey': [['', 'S-space'], ['xxx']], \ 'imactivatekey': [['', 'S-space'], ['xxx']],
\ 'isexpand': [['', '.,->', '/,/*,\\,'], [',,', '\\,,']],
\ 'isfname': [['', '@', '@,48-52'], ['xxx', '@48']], \ 'isfname': [['', '@', '@,48-52'], ['xxx', '@48']],
\ 'isident': [['', '@', '@,48-52'], ['xxx', '@48']], \ 'isident': [['', '@', '@,48-52'], ['xxx', '@48']],
\ 'isexpand': [['', '.,->', '/,/*,\\,'], [',,', '\\,,']],
\ 'iskeyword': [['', '@', '@,48-52'], ['xxx', '@48']], \ 'iskeyword': [['', '@', '@,48-52'], ['xxx', '@48']],
\ 'isprint': [['', '@', '@,48-52'], ['xxx', '@48']], \ 'isprint': [['', '@', '@,48-52'], ['xxx', '@48']],
\ 'jumpoptions': [['', 'stack'], ['xxx']], \ 'jumpoptions': [['', 'stack'], ['xxx']],
@ -248,6 +248,7 @@ let test_values = {
\ 'eol:\\u21b5', 'eol:\\U000021b5', 'eol:x,space:y'], \ 'eol:\\u21b5', 'eol:\\U000021b5', 'eol:x,space:y'],
\ ['xxx', 'eol:']], \ ['xxx', 'eol:']],
\ 'matchpairs': [['', '(:)', '(:),<:>'], ['xxx']], \ 'matchpairs': [['', '(:)', '(:),<:>'], ['xxx']],
\ 'maxsearchcount': [[1, 10, 100, 1000], [0, -1, 10000]],
\ 'messagesopt': [['hit-enter,history:1', 'hit-enter,history:10000', \ 'messagesopt': [['hit-enter,history:1', 'hit-enter,history:10000',
\ 'history:100,wait:100', 'history:0,wait:0', \ 'history:100,wait:100', 'history:0,wait:0',
\ 'hit-enter,history:1,wait:1'], \ 'hit-enter,history:1,wait:1'],
@ -275,11 +276,10 @@ let test_values = {
\ ['xxx', 'xxx,c:yes', 'xxx:', 'xxx:,c:yes']], \ ['xxx', 'xxx,c:yes', 'xxx:', 'xxx:,c:yes']],
\ 'printoptions': [['', 'header:0', 'left:10pc,top:5pc'], \ 'printoptions': [['', 'header:0', 'left:10pc,top:5pc'],
\ ['xxx', 'header:-1']], \ ['xxx', 'header:-1']],
\ 'scrollopt': [['', 'ver', 'hor', 'jump', 'ver,hor'], ['xxx']],
\ 'renderoptions': [[''], ['xxx']], \ 'renderoptions': [[''], ['xxx']],
\ 'rightleftcmd': [['search'], ['xxx']], \ 'rightleftcmd': [['search'], ['xxx']],
\ 'rulerformat': [['', 'xxx'], ['%-', '%(', '%15(%%']], \ 'rulerformat': [['', 'xxx'], ['%-', '%(', '%15(%%']],
\ 'maxsearchcount': [[1, 10, 100, 1000], [0, -1, 10000]], \ 'scrollopt': [['', 'ver', 'hor', 'jump', 'ver,hor'], ['xxx']],
\ 'selection': [['old', 'inclusive', 'exclusive'], ['', 'xxx']], \ 'selection': [['old', 'inclusive', 'exclusive'], ['', 'xxx']],
\ 'selectmode': [['', 'mouse', 'key', 'cmd', 'key,cmd'], ['xxx']], \ 'selectmode': [['', 'mouse', 'key', 'cmd', 'key,cmd'], ['xxx']],
\ 'sessionoptions': [['', 'blank', 'curdir', 'sesdir', \ 'sessionoptions': [['', 'blank', 'curdir', 'sesdir',

View File

@ -719,6 +719,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1538,
/**/ /**/
1537, 1537,
/**/ /**/