mirror of
https://github.com/neovim/neovim.git
synced 2025-09-22 11:18:19 +00:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user