]> granicus.if.org Git - vim/commitdiff
patch 9.0.0677: breakindent test accepts wrong result v9.0.0677
authorBram Moolenaar <Bram@vim.org>
Thu, 6 Oct 2022 18:21:20 +0000 (19:21 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 6 Oct 2022 18:21:20 +0000 (19:21 +0100)
Problem:    Breakindent test accepts wrong result.
Solution:   Fix the number column and adjust the expected text.

src/drawline.c
src/testdir/test_breakindent.vim
src/version.c

index 018a6d8c5f036d518ebde55644b7c1fd582f36b9..4bda102baecef93c857580cde36e445350b2c17e 100644 (file)
@@ -343,9 +343,8 @@ handle_lnum_col(
        int             num_attr UNUSED)
 {
     if ((wp->w_p_nu || wp->w_p_rnu)
-           && ((wlv->row == wlv->startrow + wlv->filler_lines
-                   && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow))
-               || vim_strchr(p_cpo, CPO_NUMCOL) == NULL))
+            && (wlv->row == wlv->startrow + wlv->filler_lines
+                        || vim_strchr(p_cpo, CPO_NUMCOL) == NULL))
     {
 #ifdef FEAT_SIGNS
        // If 'signcolumn' is set to 'number' and a sign is present
@@ -363,7 +362,7 @@ handle_lnum_col(
 #ifdef FEAT_PROP_POPUP
                  + wlv->text_prop_above_count
 #endif
-                 )
+                   && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow))
          {
              long num;
              char *fmt = "%*ld ";
index 3b606076a63150977de0e784c379e73e0b97f243..289dc08bf34c472105647dd0d55d6ae98eaf236c 100644 (file)
@@ -671,14 +671,14 @@ endfunc
 func Test_breakindent20_cpo_n_nextpage()
   let s:input = ""
   call s:test_windows('setl breakindent briopt=min:14 cpo+=n number')
-  call setline(1, repeat('a', 200))
+  call setline(1, repeat('abcdefghijklmnopqrst', 10))
   norm! 1gg
   redraw!
   let lines = s:screen_lines(1, 20)
   let expect = [
-       \ "  1 aaaaaaaaaaaaaaaa",
-       \ "    aaaaaaaaaaaaaaaa",
-       \ "    aaaaaaaaaaaaaaaa",
+       \ "  1 abcdefghijklmnop",
+       \ "    qrstabcdefghijkl",
+       \ "    mnopqrstabcdefgh",
        \ ]
   call s:compare_lines(expect, lines)
   " Scroll down one screen line
@@ -686,11 +686,10 @@ func Test_breakindent20_cpo_n_nextpage()
   norm! 5gj
   redraw!
   let lines = s:screen_lines(1, 20)
-  " FIXME: this is not the right result
   let expect = [
-       \ "<<<aaaaaaaaaaaaaaaaa",
-       \ "    aaaaaaaaaaaaaaaa",
-       \ "    aaaaaaaaaaaaaaaa",
+       \ "<<< qrstabcdefghijkl",
+       \ "    mnopqrstabcdefgh",
+       \ "    ijklmnopqrstabcd",
        \ ]
   call s:compare_lines(expect, lines)
 
@@ -698,19 +697,18 @@ func Test_breakindent20_cpo_n_nextpage()
   norm! 1gg
   let lines = s:screen_lines(1, 20)
   let expect = [
-       \ "  1 aaaaaaaaaaaaaaaa",
-       \ "      aaaaaaaaaaaaaa",
-       \ "      aaaaaaaaaaaaaa",
+       \ "  1 abcdefghijklmnop",
+       \ "      qrstabcdefghij",
+       \ "      klmnopqrstabcd",
        \ ]
   call s:compare_lines(expect, lines)
   " Scroll down one screen line
   norm! 5gj
   let lines = s:screen_lines(1, 20)
-  " FIXME: this is not the right result
   let expect = [
-       \ "<<<aaaaaaaaaaaaaaaaa",
-       \ "      aaaaaaaaaaaaaa",
-       \ "      aaaaaaaaaaaaaa",
+       \ "<<<   qrstabcdefghij",
+       \ "      klmnopqrstabcd",
+       \ "      efghijklmnopqr",
        \ ]
   call s:compare_lines(expect, lines)
 
index 5cf086ec9b3bf878f5f900b0344ad587c91790cf..6cbce975f2f0542362b59efdf34bc1be6b8598b9 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    677,
 /**/
     676,
 /**/