diff src/option.c @ 17129:4fb68abc770f v8.1.1564

patch 8.1.1564: sign column takes up space commit https://github.com/vim/vim/commit/394c5d8870b15150fc91a4c058dc571fd5eaa97e Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 17 21:48:05 2019 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 17 Jun 2019 22:00:09 +0200
parents 1c2d05cb4d1d
children 210937723567
line wrap: on
line diff
--- a/src/option.c
+++ b/src/option.c
@@ -3231,7 +3231,7 @@ static char *(p_fcl_values[]) = {"all", 
 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 @@ get_bkc_value(buf_T *buf)
      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')