0
0
mirror of https://github.com/vim/vim.git synced 2025-11-01 10:07:16 -04:00

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'.
This commit is contained in:
Bram Moolenaar
2019-08-21 15:13:41 +02:00
parent e2c453d38f
commit bd483b3f57
7 changed files with 67 additions and 8 deletions

View File

@@ -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_preview)
*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;
}