]> granicus.if.org Git - vim/commitdiff
patch 8.1.1350: "W" for wrapping not shown when more than 99 matches v8.1.1350
authorBram Moolenaar <Bram@vim.org>
Sat, 18 May 2019 17:26:29 +0000 (19:26 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 18 May 2019 17:26:29 +0000 (19:26 +0200)
Problem:    "W" for wrapping not shown when more than 99 matches.
Solution:   Adjust check for length. (Masato Nishihata, closes #4388)

src/search.c
src/testdir/test_search_stat.vim
src/version.c

index d9b6a7ca852354647036ca7af83652adfba528d6..56bd763dda28174d8cf1aa1be2bac91a647c7c69 100644 (file)
@@ -5012,7 +5012,7 @@ search_stat(
        }
 
        len = STRLEN(t);
-       if (show_top_bot_msg && len + 3 < SEARCH_STAT_BUF_LEN)
+       if (show_top_bot_msg && len + 2 < SEARCH_STAT_BUF_LEN)
        {
            STRCPY(t + len, " W");
            len += 2;
index 107cd54a0e022633d2eee3cdd5eed7a5980bf5c2..322d137e2ec698867e2ea57f4760f88bedda0d53 100644 (file)
@@ -40,12 +40,20 @@ func! Test_search_stat()
   let g:a = execute(':unsilent :norm! n')
   let stat = '\[>99/>99\]'
   call assert_match(pat .. stat, g:a)
+  call cursor(line('$'), 1)
+  let g:a = execute(':unsilent :norm! n')
+  let stat = '\[1/>99\] W'
+  call assert_match(pat .. stat, g:a)
 
   " 5) Many matches
   call cursor(1, 1)
   let g:a = execute(':unsilent :norm! n')
   let stat = '\[2/>99\]'
   call assert_match(pat .. stat, g:a)
+  call cursor(1, 1)
+  let g:a = execute(':unsilent :norm! N')
+  let stat = '\[>99/>99\] W'
+  call assert_match(pat .. stat, g:a)
 
   " 6) right-left
   if exists("+rightleft")
index efddd3eaf235a1363cc4475ac76bb314b1910cb7..ac07931988e529be3c1afbeb8da5c015c29d6d30 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1350,
 /**/
     1349,
 /**/