summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-05-29 17:56:37 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-29 17:56:37 +0200
commita06e345af5b8261c072c95b0446e67cfda439848 (patch)
tree35ce3ff09b50d7a058eb40d55b6d99de6d54e755 /src/drawline.c
parent5a6cfb3ff2f2f422a3732f3855616c89dd19c19d (diff)
patch 8.2.2903: cursor position wrong on wrapped line with 'signcolumn'v8.2.2903
Problem: Cursor position wrong on wrapped line with 'signcolumn'. Solution: Don't add space for showbreak twice. (Christian Brabandt, closes #8262)
Diffstat (limited to 'src/drawline.c')
-rw-r--r--src/drawline.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 13be022a93..7b6777e64c 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1981,6 +1981,12 @@ win_line(
// TODO: is passing p for start of the line OK?
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
NULL) - 1;
+
+ // We have just drawn the showbreak value, no need to add
+ // space for it again
+ if (vcol == vcol_sbr)
+ n_extra -= MB_CHARLEN(get_showbreak_value(wp));
+
if (c == TAB && n_extra + col > wp->w_width)
# ifdef FEAT_VARTABS
n_extra = tabstop_padding(vcol, wp->w_buffer->b_p_ts,