]> granicus.if.org Git - vim/commitdiff
patch 8.2.1004: line numbers below filler lines not always updated v8.2.1004
authorBram Moolenaar <Bram@vim.org>
Thu, 18 Jun 2020 17:15:27 +0000 (19:15 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 18 Jun 2020 17:15:27 +0000 (19:15 +0200)
Problem:    Line numbers below filler lines not always updated.
Solution:   Don't break out of the win_line() loop too early. (Christian
            Brabandt, closes #6294, closes #6138)

src/drawline.c
src/testdir/dumps/Test_diff_rnu_01.dump [new file with mode: 0644]
src/testdir/dumps/Test_diff_rnu_02.dump [new file with mode: 0644]
src/testdir/dumps/Test_diff_rnu_03.dump [new file with mode: 0644]
src/testdir/test_diffmode.vim
src/version.c

index 9d65aa43ec3456e421eb2ce5a7f8fe734e19382b..6d14bda7b6ab9306973ab6c79861b2f500fe5e88 100644 (file)
@@ -1287,13 +1287,13 @@ win_line(
        // When still displaying '$' of change command, stop at cursor.
        // When only displaying the (relative) line number and that's done,
        // stop here.
-       if ((dollar_vcol >= 0 && wp == curwin
-                  && lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol
+       if (((dollar_vcol >= 0 && wp == curwin
+                  && lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol)
+               || (number_only && draw_state > WL_NR))
 #ifdef FEAT_DIFF
                                   && filler_todo <= 0
 #endif
                )
-               || (number_only && draw_state > WL_NR))
        {
            screen_line(screen_row, wp->w_wincol, col, -(int)wp->w_width,
                                                            screen_line_flags);
diff --git a/src/testdir/dumps/Test_diff_rnu_01.dump b/src/testdir/dumps/Test_diff_rnu_01.dump
new file mode 100644 (file)
index 0000000..dc7c0f9
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&|1+0#af5f00255&| @2>a+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|1| |a+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|2| |a+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010| +0&#ffd7ff255@33||+1&#ffffff0| +0#af5f00255&@1|3| |y+2#0000000#ff404010| +0&#ffd7ff255@31
+| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#af5f00255&@3|-+0#4040ff13#afffff255@32
+| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#af5f00255&@3|-+0#4040ff13#afffff255@32
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|4| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|5| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|6| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|7| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|8| |b+0#0000000&| @31
+|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|A|l@1| |[+3&&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|A|l@1
+| +0&&@74
diff --git a/src/testdir/dumps/Test_diff_rnu_02.dump b/src/testdir/dumps/Test_diff_rnu_02.dump
new file mode 100644 (file)
index 0000000..32ffc40
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|1| |a+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&|2+0#af5f00255&| @2>a+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|1| |a+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010| +0&#ffd7ff255@33||+1&#ffffff0| +0#af5f00255&@1|2| |y+2#0000000#ff404010| +0&#ffd7ff255@31
+| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#af5f00255&@3|-+0#4040ff13#afffff255@32
+| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#af5f00255&@3|-+0#4040ff13#afffff255@32
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|3| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|4| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|5| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|6| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|7| |b+0#0000000&| @31
+|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @5|2|,|1| @11|A|l@1| |[+3&&|N|o| |N|a|m|e|]| |[|+|]| @5|2|,|1| @11|A|l@1
+| +0&&@74
diff --git a/src/testdir/dumps/Test_diff_rnu_03.dump b/src/testdir/dumps/Test_diff_rnu_03.dump
new file mode 100644 (file)
index 0000000..8c8b938
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|2| |a+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|1| |a+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|a+0#0000000#ffffff0| @33||+1&&|3+0#af5f00255&| @2>a+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|x+2#0000000#ff404010| +0&#ffd7ff255@33||+1&#ffffff0| +0#af5f00255&@1|1| |y+2#0000000#ff404010| +0&#ffd7ff255@31
+| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#af5f00255&@3|-+0#4040ff13#afffff255@32
+| +0#0000e05#a8a8a8255@1|x+0#0000000#5fd7ff255| @33||+1&#ffffff0| +0#af5f00255&@3|-+0#4040ff13#afffff255@32
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|2| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|3| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|4| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|5| |b+0#0000000&| @31
+| +0#0000e05#a8a8a8255@1|b+0#0000000#ffffff0| @33||+1&&| +0#af5f00255&@1|6| |b+0#0000000&| @31
+|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @5|3|,|1| @11|A|l@1| |[+3&&|N|o| |N|a|m|e|]| |[|+|]| @5|3|,|1| @11|A|l@1
+| +0&&@74
index a251d3fec2fc645218280327d8e8efebe1daba91..4544834b9dc241cb18146baeb253c7832d206d47 100644 (file)
@@ -1093,4 +1093,29 @@ func Test_patchexpr()
   %bwipe!
 endfunc
 
+func Test_diff_rnu()
+  CheckScreendump
+
+  let content =<< trim END
+    call setline(1, ['a', 'a', 'a', 'y', 'b', 'b', 'b', 'b', 'b'])
+    vnew
+    call setline(1, ['a', 'a', 'a', 'x', 'x', 'x', 'b', 'b', 'b', 'b', 'b'])
+    windo diffthis
+    setlocal number rnu foldcolumn=0
+  END
+  call writefile(content, 'Xtest_diff_rnu')
+  let buf = RunVimInTerminal('-S Xtest_diff_rnu', {})
+
+  call VerifyScreenDump(buf, 'Test_diff_rnu_01', {})
+
+  call term_sendkeys(buf, "j")
+  call VerifyScreenDump(buf, 'Test_diff_rnu_02', {})
+  call term_sendkeys(buf, "j")
+  call VerifyScreenDump(buf, 'Test_diff_rnu_03', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('Xtest_diff_rnu')
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index 2cdb140cf465a16b64e7bceb7cf4d3c2bb7f84d2..67dbe9b33ee9921949039db7a7168427da9e4b95 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1004,
 /**/
     1003,
 /**/