patch 9.0.1800: Cursor position still wrong with 'showbreak' and virtual text
Problem: Cursor position still wrong with 'showbreak' and virtual text
after last character or 'listchars' "eol".
Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also
fix first char of virtual text not shown at the start of a screen
line.
closes: #12478
closes: #12532
closes: #12904
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
diff --git a/src/charset.c b/src/charset.c
index 971fefc..7901479 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1358,13 +1358,13 @@
head_mid += get_breakindent_win(wp, line);
if (head_mid > 0 && wcol + size > wp->w_width)
{
- // calculate effective window width
+ // Calculate effective window width.
int prev_rem = wp->w_width - wcol;
int width = width2 - head_mid;
if (width <= 0)
width = 1;
- // divide "size - prev_width" by "width", rounding up
+ // Divide "size - prev_rem" by "width", rounding up.
int cnt = (size - prev_rem + width - 1) / width;
added += cnt * head_mid;