summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-04 11:59:28 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-04 11:59:28 +0200
commite4b407f536ba8bd007152649a347a95320d80fce (patch)
tree306f3fa571a153b3fa0e7d6c66d2ec1f668e8d04 /src/option.c
parente296e3177b67bdcaa8b1f144d2495b9413e7055c (diff)
downloadvim-git-e4b407f536ba8bd007152649a347a95320d80fce.tar.gz
patch 8.1.1623: display wrong with signs in narrow number columnv8.1.1623
Problem: Display wrong with signs in narrow number column. Solution: Increase the numbercolumn width if needed. (Yegappan Lakshmanan, closes #4606)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/option.c b/src/option.c
index cd50e8d62..4856a598d 100644
--- a/src/option.c
+++ b/src/option.c
@@ -7454,11 +7454,17 @@ did_set_string_option(
#endif /* FEAT_INS_EXPAND */
#ifdef FEAT_SIGNS
- /* 'signcolumn' */
+ // 'signcolumn'
else if (varp == &curwin->w_p_scl)
{
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;
}
#endif