aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 52ab2ad25e..afdb04ebd8 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -780,6 +780,16 @@ int number_width(win_T *wp)
}
wp->w_nrwidth_line_count = lnum;
+ // make best estimate for 'statuscolumn'
+ 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 = 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;
+ }
+
n = 0;
do {
lnum /= 10;