]> granicus.if.org Git - vim/commitdiff
patch 9.0.0718: extra empty line between two virtual text "below" v9.0.0718
authorBram Moolenaar <Bram@vim.org>
Mon, 10 Oct 2022 20:10:03 +0000 (21:10 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 10 Oct 2022 20:10:03 +0000 (21:10 +0100)
Problem:    Extra empty line between two virtual text "below" when 'wrap' and
            'number' are set.
Solution:   Reset "before" when there is no text in the screen line.
            (closes #11334)

src/drawline.c
src/testdir/dumps/Test_prop_with_text_after_below_trunc_2.dump [new file with mode: 0644]
src/testdir/test_textprop.vim
src/version.c

index 3d8b02ebef8b03506f568a6221185d863b70d533..bc1b20a19f5d5e49cc6d7afc904081e45fa071a5 100644 (file)
@@ -639,7 +639,7 @@ text_prop_position(
 
     if (wrap || right || above || below || padding > 0 || n_used < *n_extra)
     {
-       int         col_off = win_col_off(wp) + win_col_off2(wp);
+       int         col_off = win_col_off(wp) - win_col_off2(wp);
        int         skip_add = 0;
 
        if (above)
@@ -655,7 +655,7 @@ text_prop_position(
            if (before < 0
                    || !(right || below)
                    || (below
-                       ? (col_with_padding == 0 || !wp->w_p_wrap)
+                       ? (col_with_padding <= col_off || !wp->w_p_wrap)
                        : (n_used < *n_extra)))
            {
                if (right && (wrap || room < PROP_TEXT_MIN_CELLS))
diff --git a/src/testdir/dumps/Test_prop_with_text_after_below_trunc_2.dump b/src/testdir/dumps/Test_prop_with_text_after_below_trunc_2.dump
new file mode 100644 (file)
index 0000000..1d93f9f
--- /dev/null
@@ -0,0 +1,8 @@
+| +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d| |f|a|s| |d|f|t+0#e000e06&|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|…
+| +0#af5f00255&@3|t+0#e000e06&|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|s| |o|v|e|r| |t|h|e| |l|a|z|y| |d|o|g| +0#0000000&@12
+| +0#af5f00255&@1|2| |t+0#0000000&|w>o| @52
+|~+0#4040ff13&| @58
+|~| @58
+|~| @58
+|~| @58
+|:+0#0000000&|s|e|t| |n|u|m|b|e|r| @30|2|,|3| @10|A|l@1| 
index b4178e5f25432c81254ed431f3c1aadcf9a294f1..3fb27c9a6fd4ed158352629d5513b1b48a386d57 100644 (file)
@@ -2653,6 +2653,9 @@ func Test_props_with_text_after_below_trunc()
   let buf = RunVimInTerminal('-S XscriptPropsAfterTrunc', #{rows: 8, cols: 60})
   call VerifyScreenDump(buf, 'Test_prop_with_text_after_below_trunc_1', {})
 
+  call term_sendkeys(buf, ":set number\<CR>")
+  call VerifyScreenDump(buf, 'Test_prop_with_text_after_below_trunc_2', {})
+
   call StopVimInTerminal(buf)
 endfunc
 
index f33673e15f88efc89f3fdef84bde22283a9e1281..ac3b56791786ed78e8d7df0e10c0b5473aa2efd9 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    718,
 /**/
     717,
 /**/