From bfe94d0a0814eab5e9f9b6c6b06e770ba904da9f Mon Sep 17 00:00:00 2001 From: erw7 Date: Tue, 14 Jul 2020 05:15:04 +0900 Subject: 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) https://github.com/vim/vim/commit/e4b407f536ba8bd007152649a347a95320d80fce --- src/nvim/option.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index 4157d28894..97f31b4754 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3183,6 +3183,13 @@ ambw_end: if (check_opt_strings(*varp, p_scl_values, false) != OK) { errmsg = e_invarg; } + // When changing the 'signcolumn' to or from 'number', recompute the + // width of the number column if 'number' or 'relativenumber' is set. + if (((*oldval == 'n' && *(oldval + 1) == 'u') + || (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) =='u')) + && (curwin->w_p_nu || curwin->w_p_rnu)) { + curwin->w_nrwidth_line_count = 0; + } } else if (varp == &curwin->w_p_fdc || varp == &curwin->w_allbuf_opt.wo_fdc) { // 'foldcolumn' if (check_opt_strings(*varp, p_fdc_values, false) != OK) { -- cgit