patch 8.1.1564: sign column takes up space
Problem: Sign column takes up space. (Adam Stankiewicz)
Solution: Optionally put signs in the number column. (Yegappan Lakshmanan,
closes #4555, closes #4515)
diff --git a/src/option.c b/src/option.c
index 51d6212..a1cddcf 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3231,7 +3231,7 @@
static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "noinsert", "noselect", NULL};
#endif
#ifdef FEAT_SIGNS
-static char *(p_scl_values[]) = {"yes", "no", "auto", NULL};
+static char *(p_scl_values[]) = {"yes", "no", "auto", "number", NULL};
#endif
#if defined(MSWIN) && defined(FEAT_TERMINAL)
static char *(p_twt_values[]) = {"winpty", "conpty", "", NULL};
@@ -13556,6 +13556,12 @@
int
signcolumn_on(win_T *wp)
{
+ // If 'signcolumn' is set to 'number', signs are displayed in the 'number'
+ // column (if present). Otherwise signs are to be displayed in the sign
+ // column.
+ if (*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u')
+ return wp->w_buffer->b_signlist != NULL && !wp->w_p_nu && !wp->w_p_rnu;
+
if (*wp->w_p_scl == 'n')
return FALSE;
if (*wp->w_p_scl == 'y')