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'.
diff --git a/src/popupwin.c b/src/popupwin.c
index 99a40af..a803faa 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -935,7 +935,7 @@
/*
* 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 @@
*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;
}