0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 8.1.1623: display wrong with signs in narrow number column

Problem:    Display wrong with signs in narrow number column.
Solution:   Increase the numbercolumn width if needed. (Yegappan Lakshmanan,
            closes #4606)
This commit is contained in:
Bram Moolenaar
2019-07-04 11:59:28 +02:00
parent e296e3177b
commit e4b407f536
5 changed files with 93 additions and 1 deletions

View File

@@ -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;