patch 9.0.0297: cursor position wrong after right aligned virtual text
Problem: Cursor position wrong after right aligned virtual text. (Iizuka
Masashi)
Solution: Take the width of the column offset into account. (closes #10997)
Also fix virtual text positioning.
diff --git a/src/charset.c b/src/charset.c
index 299de54..b26ebb9 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1187,7 +1187,8 @@
for (i = 0; i < cts->cts_text_prop_count; ++i)
{
- textprop_T *tp = cts->cts_text_props + i;
+ textprop_T *tp = cts->cts_text_props + i;
+ int col_off = win_col_off(wp);
// Watch out for the text being deleted. "cts_text_props" is a
// copy, the text prop may actually have been removed from the line.
@@ -1209,7 +1210,7 @@
int n_extra = (int)STRLEN(p);
cells = text_prop_position(wp, tp,
- (vcol + size) % wp->w_width,
+ (vcol + size) % (wp->w_width - col_off) + col_off,
&n_extra, &p, NULL, NULL);
#ifdef FEAT_LINEBREAK
no_sbr = TRUE; // don't use 'showbreak' now