Skip to content

Commit dc6855a

Browse files
committed
patch 8.1.1350: "W" for wrapping not shown when more than 99 matches
Problem: "W" for wrapping not shown when more than 99 matches. Solution: Adjust check for length. (Masato Nishihata, closes #4388)
1 parent cf0bfd9 commit dc6855a

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/search.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5012,7 +5012,7 @@ search_stat(
50125012
}
50135013

50145014
len = STRLEN(t);
5015-
if (show_top_bot_msg && len + 3 < SEARCH_STAT_BUF_LEN)
5015+
if (show_top_bot_msg && len + 2 < SEARCH_STAT_BUF_LEN)
50165016
{
50175017
STRCPY(t + len, " W");
50185018
len += 2;

src/testdir/test_search_stat.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,20 @@ func! Test_search_stat()
4040
let g:a = execute(':unsilent :norm! n')
4141
let stat = '\[>99/>99\]'
4242
call assert_match(pat .. stat, g:a)
43+
call cursor(line('$'), 1)
44+
let g:a = execute(':unsilent :norm! n')
45+
let stat = '\[1/>99\] W'
46+
call assert_match(pat .. stat, g:a)
4347

4448
" 5) Many matches
4549
call cursor(1, 1)
4650
let g:a = execute(':unsilent :norm! n')
4751
let stat = '\[2/>99\]'
4852
call assert_match(pat .. stat, g:a)
53+
call cursor(1, 1)
54+
let g:a = execute(':unsilent :norm! N')
55+
let stat = '\[>99/>99\] W'
56+
call assert_match(pat .. stat, g:a)
4957

5058
" 6) right-left
5159
if exists("+rightleft")

src/version.c

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

768768
static int included_patches[] =
769769
{ /* Add new patch number below this line */
770+
/**/
771+
1350,
770772
/**/
771773
1349,
772774
/**/

0 commit comments

Comments
 (0)