patch 9.0.0442: virtual text "above" doesn't handel line numbers
Problem: Virtual text "above" doesn't handel line numbers.
Solution: Take the left column offset into account. (issue #11084)
Also make padding work.
diff --git a/src/drawline.c b/src/drawline.c
index 56d42e2..7f96603 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -350,7 +350,7 @@
if (above)
{
before = 0;
- after = wp->w_width - cells;
+ after = wp->w_width - cells - win_col_off(wp) - padding;
}
else
{
@@ -436,6 +436,8 @@
*p_extra = l;
*n_extra = n_used + before + after + padding;
*n_attr = mb_charlen(*p_extra);
+ if (above)
+ *n_attr -= padding;
*n_attr_skip = before + padding + col_off;
}
}
@@ -1858,8 +1860,8 @@
dont_use_showbreak = TRUE;
}
#endif
- if ((right || above || below || !wrap || padding > 0)
- && wp->w_width > 2)
+ if ((right || above || below || !wrap
+ || padding > 0) && wp->w_width > 2)
{
char_u *prev_p_extra = wlv.p_extra;
int start_line;