Mercurial > vim
diff src/screen.c @ 17247:cbd0432cf8ff v8.1.1623
patch 8.1.1623: display wrong with signs in narrow number column
commit https://github.com/vim/vim/commit/e4b407f536ba8bd007152649a347a95320d80fce
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 4 11:59:28 2019 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 04 Jul 2019 12:00:09 +0200 |
parents | f1c7b7a4d9e4 |
children | 82b5d981fe59 |
line wrap: on
line diff
--- 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;