vim-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 vim/vim#4606)
e4b407f536
This commit is contained in:
erw7
2020-07-14 05:15:04 +09:00
committed by Shougo Matsushita
parent d3eddcf630
commit bfe94d0a08
4 changed files with 89 additions and 2 deletions

View File

@@ -7400,9 +7400,17 @@ int number_width(win_T *wp)
++n;
} while (lnum > 0);
/* 'numberwidth' gives the minimal width plus one */
if (n < wp->w_p_nuw - 1)
// 'numberwidth' gives the minimal width plus one
if (n < wp->w_p_nuw - 1) {
n = wp->w_p_nuw - 1;
}
// 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;
}
wp->w_nrwidth_width = n;
return n;