summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-04 11:59:28 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-04 11:59:28 +0200
commite4b407f536ba8bd007152649a347a95320d80fce (patch)
tree306f3fa571a153b3fa0e7d6c66d2ec1f668e8d04 /src/screen.c
parente296e3177b67bdcaa8b1f144d2495b9413e7055c (diff)
downloadvim-git-e4b407f536ba8bd007152649a347a95320d80fce.tar.gz
patch 8.1.1623: display wrong with signs in narrow number columnv8.1.1623
Problem: Display wrong with signs in narrow number column. Solution: Increase the numbercolumn width if needed. (Yegappan Lakshmanan, closes #4606)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c
index d39fca263..b810065ab 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -11333,6 +11333,14 @@ number_width(win_T *wp)
if (n < wp->w_p_nuw - 1)
n = wp->w_p_nuw - 1;
+# ifdef FEAT_SIGNS
+ // If 'signcolumn' is set to 'number' and there is a sign to display, then
+ // the minimal width for the number column is 2.
+ if (n < 2 && (wp->w_buffer->b_signlist != NULL)
+ && (*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u'))
+ n = 2;
+# endif
+
wp->w_nrwidth_width = n;
wp->w_nuw_cached = wp->w_p_nuw;
return n;