summaryrefslogtreecommitdiffstats
path: root/src/charset.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-27 19:04:14 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-27 19:04:14 +0200
commit6a3897232aecd3e8b9e8b23955e55c1993e5baec (patch)
tree8a24311230d8c60a43290b5bcaed2080ba31af6a /src/charset.c
parent9a6cf34a1ebdd258acbc6f186bffed42cec2c1a0 (diff)
patch 9.0.1800: Cursor position still wrong with 'showbreak' and virtual textv9.0.1800
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>
Diffstat (limited to 'src/charset.c')
-rw-r--r--src/charset.c4
1 files changed, 2 insertions, 2 deletions
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;