From 6a3897232aecd3e8b9e8b23955e55c1993e5baec Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 27 Aug 2023 19:04:14 +0200 Subject: 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 Co-authored-by: zeertzjq --- src/charset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/charset.c') diff --git a/src/charset.c b/src/charset.c index 971fefc614..7901479d43 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1358,13 +1358,13 @@ win_lbr_chartabsize( 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; -- cgit v1.2.3