aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-01-12 10:40:53 +0100
committerLuuk van Baal <luukvbaal@gmail.com>2023-01-16 14:03:09 +0100
commit85111ca0f4916ade5caa4e1ca836d615afdba6f8 (patch)
treed4f3886f812530e2d8bbb0aeef418ac74eab4b2a /src/nvim/screen.c
parentef89f9fd46ab591183b7f59f31f5a2e55f7a526b (diff)
downloadrneovim-85111ca0f4916ade5caa4e1ca836d615afdba6f8.tar.gz
rneovim-85111ca0f4916ade5caa4e1ca836d615afdba6f8.tar.bz2
rneovim-85111ca0f4916ade5caa4e1ca836d615afdba6f8.zip
fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines
Problem: The `'statuscolumn'` was not re-evaluated for wrapped lines, when preceded by virtual/filler lines. There was also no way to distinguish virtual and wrapped lines in the status column. Solution: Make sure to rebuild the statuscolumn, and replace variable `v:wrap` with `v:virtnum`. `v:virtnum` is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index b18bf7ed6a..6a3103123b 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -784,7 +784,7 @@ int number_width(win_T *wp)
if (*wp->w_p_stc != NUL) {
char buf[MAXPATHL];
wp->w_nrwidth_width = 0;
- n = build_statuscol_str(wp, true, false, lnum, 0, 0, NUL, buf, NULL, NULL);
+ n = build_statuscol_str(wp, lnum, 0, 0, NUL, buf, NULL, NULL);
n = MAX(n, (wp->w_p_nu || wp->w_p_rnu) * (int)wp->w_p_nuw);
wp->w_nrwidth_width = MIN(n, MAX_NUMBERWIDTH);
return wp->w_nrwidth_width;