Skip to content

Commit 7306e8f

Browse files
zeertzjqchrisbra
authored andcommitted
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: vim#17720 Signed-off-by: zeertzjq <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 41adebe commit 7306e8f

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

runtime/doc/builtin.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2025 Jul 06
1+
*builtin.txt* For Vim version 9.1. Last change: 2025 Jul 11
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -9378,11 +9378,12 @@ searchcount([{options}]) *searchcount()*
93789378

93799379
To get the last search count when |n| or |N| was pressed, call
93809380
this function with `recompute: 0` . This sometimes returns
9381-
wrong information because |n| and |N|'s maximum count is 99.
9382-
If it exceeded 99 the result must be max count + 1 (100). If
9383-
you want to get correct information, specify `recompute: 1`: >
9381+
wrong information because of 'maxsearchcount'.
9382+
If the count exceeded 'maxsearchcount', the result must be
9383+
'maxsearchcount' + 1. If you want to get correct information,
9384+
specify `recompute: 1`: >
93849385
9385-
" result == maxcount + 1 (100) when many matches
9386+
" result == 'maxsearchcount' + 1 when many matches
93869387
let result = searchcount(#{recompute: 0})
93879388
93889389
" Below returns correct result (recompute defaults
@@ -9469,7 +9470,7 @@ searchcount([{options}]) *searchcount()*
94699470
result. if search exceeded
94709471
total count, "total" value
94719472
becomes `maxcount + 1`
9472-
(default: 99)
9473+
(default: 'maxsearchcount')
94739474
pos |List| `[lnum, col, off]` value
94749475
when recomputing the result.
94759476
this changes "current" result

runtime/optwin.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ call <SID>AddOption("ignorecase", gettext("ignore case when using a search patte
283283
call <SID>BinOptionG("ic", &ic)
284284
call <SID>AddOption("smartcase", gettext("override 'ignorecase' when pattern has upper case characters"))
285285
call <SID>BinOptionG("scs", &scs)
286-
call <SID>AddOption("maxsearchcount", gettext("Maximum number for the search count feature"))
286+
call <SID>AddOption("maxsearchcount", gettext("maximum number for the search count feature"))
287287
call <SID>OptionG("msc", &msc)
288288
call <SID>AddOption("casemap", gettext("what method to use for changing case of letters"))
289289
call <SID>OptionG("cmp", &cmp)

src/testdir/test_search_stat.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,10 @@ func Test_search_stat_option()
536536
\ searchcount(#{recompute: 0}))
537537
call assert_equal(
538538
\ #{exact_match: 1, current: 27992, incomplete: 0, maxcount:0, total: 28000},
539-
\ searchcount(#{recompute: v:true, maxcount: 0, timeout: 200}))
539+
\ searchcount(#{recompute: v:true, maxcount: 0, timeout: 500}))
540540
call assert_equal(
541541
\ #{exact_match: 1, current: 1, incomplete: 0, maxcount: 0, total: 28000},
542-
\ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 200}))
542+
\ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 500}))
543543
call cursor(line('$'), 1)
544544
let g:a = execute(':unsilent :norm! n')
545545
let stat = 'W \[1/>999\]'
@@ -549,10 +549,10 @@ func Test_search_stat_option()
549549
\ searchcount(#{recompute: 0}))
550550
call assert_equal(
551551
\ #{current: 1, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0},
552-
\ searchcount(#{recompute: 1, maxcount: 0, timeout: 200}))
552+
\ searchcount(#{recompute: 1, maxcount: 0, timeout: 500}))
553553
call assert_equal(
554554
\ #{current: 27991, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0},
555-
\ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 200}))
555+
\ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 500}))
556556

557557
" Many matches
558558
call cursor(1, 1)

src/testdir/util/gen_opt_test.vim

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,22 @@ let test_values = {
158158
\ 's', 's/tmp/dir\\\ with\\\ space/*',
159159
\ 'w,b,k/tmp/dir\\\ with\\\ space/*,s'],
160160
\ ['xxx']],
161-
\ 'concealcursor': [['', 'n', 'v', 'i', 'c', 'nvic'], ['xxx']],
162-
\ 'completeopt': [['', 'menu', 'menuone', 'longest', 'preview', 'popup',
163-
\ 'popuphidden', 'noinsert', 'noselect', 'fuzzy', "preinsert", 'menu,longest'],
164-
\ ['xxx', 'menu,,,longest,']],
165161
\ 'completefuzzycollect': [['', 'keyword', 'files', 'whole_line',
166162
\ 'keyword,whole_line', 'files,whole_line', 'keyword,files,whole_line'],
167163
\ ['xxx', 'keyword,,,whole_line,']],
168164
\ 'completeitemalign': [['abbr,kind,menu', 'menu,abbr,kind'],
169165
\ ['', 'xxx', 'abbr', 'abbr,menu', 'abbr,menu,kind,abbr',
170166
\ 'abbr1234,kind,menu']],
167+
\ 'completeopt': [['', 'menu', 'menuone', 'longest', 'preview', 'popup',
168+
\ 'popuphidden', 'noinsert', 'noselect', 'fuzzy', "preinsert", 'menu,longest'],
169+
\ ['xxx', 'menu,,,longest,']],
171170
\ 'completepopup': [['', 'height:13', 'width:20', 'highlight:That',
172171
\ 'align:item', 'align:menu', 'border:on', 'border:off',
173172
\ 'width:10,height:234,highlight:Mine'],
174173
\ ['xxx', 'xxx:99', 'height:yes', 'width:no', 'align:xxx',
175174
\ 'border:maybe', 'border:1', 'border:']],
176175
\ 'completeslash': [['', 'slash', 'backslash'], ['xxx']],
176+
\ 'concealcursor': [['', 'n', 'v', 'i', 'c', 'nvic'], ['xxx']],
177177
\ 'cryptmethod': [['', 'zip'], ['xxx']],
178178
\ 'cscopequickfix': [['', 's-', 'g-', 'd-', 'c-', 't-', 'e-', 'f-', 'i-',
179179
\ 'a-', 's-,c+,e0'],
@@ -210,29 +210,29 @@ let test_values = {
210210
\ 'stl:\ ,vert:\|,fold:\\,trunc:…,diff:x'],
211211
\ ['xxx', 'vert:', 'trunc:', "trunc:\b"]],
212212
\ 'foldclose': [['', 'all'], ['xxx']],
213+
\ 'foldmarker': [['((,))'], ['', 'xxx', '{{{,']],
213214
\ 'foldmethod': [['manual', 'indent', 'expr', 'marker', 'syntax', 'diff'],
214215
\ ['', 'xxx', 'expr,diff']],
215216
\ 'foldopen': [['', 'all', 'block', 'hor', 'insert', 'jump', 'mark',
216217
\ 'percent', 'quickfix', 'search', 'tag', 'undo', 'hor,jump'],
217218
\ ['xxx']],
218-
\ 'foldmarker': [['((,))'], ['', 'xxx', '{{{,']],
219219
\ 'formatoptions': [['', 't', 'c', 'r', 'o', '/', 'q', 'w', 'a', 'n', '2',
220220
\ 'v', 'b', 'l', 'm', 'M', 'B', '1', ']', 'j', 'p', 'vt', 'v,t'],
221221
\ ['xxx']],
222222
\ 'guicursor': [['', 'n:block-Cursor'], ['xxx']],
223223
\ 'guifont': [['', fontname], []],
224-
\ 'guifontwide': [['', fontname], []],
225224
\ 'guifontset': [['', fontname], []],
225+
\ 'guifontwide': [['', fontname], []],
226226
\ 'guioptions': [['', '!', 'a', 'P', 'A', 'c', 'd', 'e', 'f', 'i', 'm',
227227
\ 'M', 'g', 't', 'T', 'r', 'R', 'l', 'L', 'b', 'h', 'v', 'p', 'F',
228228
\ 'k', '!abvR'],
229229
\ ['xxx', 'a,b']],
230230
\ 'helplang': [['', 'de', 'de,it'], ['xxx']],
231231
\ 'highlight': [['', 'e:Error'], ['xxx']],
232232
\ 'imactivatekey': [['', 'S-space'], ['xxx']],
233+
\ 'isexpand': [['', '.,->', '/,/*,\\,'], [',,', '\\,,']],
233234
\ 'isfname': [['', '@', '@,48-52'], ['xxx', '@48']],
234235
\ 'isident': [['', '@', '@,48-52'], ['xxx', '@48']],
235-
\ 'isexpand': [['', '.,->', '/,/*,\\,'], [',,', '\\,,']],
236236
\ 'iskeyword': [['', '@', '@,48-52'], ['xxx', '@48']],
237237
\ 'isprint': [['', '@', '@,48-52'], ['xxx', '@48']],
238238
\ 'jumpoptions': [['', 'stack'], ['xxx']],
@@ -248,6 +248,7 @@ let test_values = {
248248
\ 'eol:\\u21b5', 'eol:\\U000021b5', 'eol:x,space:y'],
249249
\ ['xxx', 'eol:']],
250250
\ 'matchpairs': [['', '(:)', '(:),<:>'], ['xxx']],
251+
\ 'maxsearchcount': [[1, 10, 100, 1000], [0, -1, 10000]],
251252
\ 'messagesopt': [['hit-enter,history:1', 'hit-enter,history:10000',
252253
\ 'history:100,wait:100', 'history:0,wait:0',
253254
\ 'hit-enter,history:1,wait:1'],
@@ -275,11 +276,10 @@ let test_values = {
275276
\ ['xxx', 'xxx,c:yes', 'xxx:', 'xxx:,c:yes']],
276277
\ 'printoptions': [['', 'header:0', 'left:10pc,top:5pc'],
277278
\ ['xxx', 'header:-1']],
278-
\ 'scrollopt': [['', 'ver', 'hor', 'jump', 'ver,hor'], ['xxx']],
279279
\ 'renderoptions': [[''], ['xxx']],
280280
\ 'rightleftcmd': [['search'], ['xxx']],
281281
\ 'rulerformat': [['', 'xxx'], ['%-', '%(', '%15(%%']],
282-
\ 'maxsearchcount': [[1, 10, 100, 1000], [0, -1, 10000]],
282+
\ 'scrollopt': [['', 'ver', 'hor', 'jump', 'ver,hor'], ['xxx']],
283283
\ 'selection': [['old', 'inclusive', 'exclusive'], ['', 'xxx']],
284284
\ 'selectmode': [['', 'mouse', 'key', 'cmd', 'key,cmd'], ['xxx']],
285285
\ 'sessionoptions': [['', 'blank', 'curdir', 'sesdir',

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ static char *(features[]) =
719719

720720
static int included_patches[] =
721721
{ /* Add new patch number below this line */
722+
/**/
723+
1538,
722724
/**/
723725
1537,
724726
/**/

0 commit comments

Comments
 (0)