diff src/popupwin.c @ 17811:b5499bf22a97 v8.1.1902

patch 8.1.1902: cannot have an info popup without a border Commit: https://github.com/vim/vim/commit/bd483b3f577ee1af7c8c8bf440f5d81613336975 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 21 15:13:41 2019 +0200 patch 8.1.1902: cannot have an info popup without a border Problem: Cannot have an info popup without a border. Solution: Add the "border" item to 'completepopup'.
author Bram Moolenaar <Bram@vim.org>
date Wed, 21 Aug 2019 15:15:03 +0200
parents 55c167b08c2b
children 9ec2526c04c5
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -935,7 +935,7 @@ add_popup_dicts(buf_T *buf, list_T *l)
 /*
  * Get the padding plus border at the top, adjusted to 1 if there is a title.
  */
-    static int
+    int
 popup_top_extra(win_T *wp)
 {
     int	extra = wp->w_popup_border[0] + wp->w_popup_padding[0];
@@ -1350,6 +1350,24 @@ parse_popup_option(win_T *wp, int is_pre
 		*p = c;
 	    }
 	}
+	else if (STRNCMP(s, "border:", 7) == 0)
+	{
+	    char_u	*arg = s + 7;
+	    int		on = STRNCMP(arg, "on", 2) == 0 && arg + 2 == p;
+	    int		off = STRNCMP(arg, "off", 3) == 0 && arg + 3 == p;
+	    int		i;
+
+	    if (!on && !off)
+		return FAIL;
+	    if (wp != NULL)
+	    {
+		for (i = 0; i < 4; ++i)
+		    wp->w_popup_border[i] = on ? 1 : 0;
+		if (off)
+		    // only show the X for close when there is a border
+		    wp->w_popup_close = POPCLOSE_NONE;
+	    }
+	}
 	else
 	    return FAIL;
     }