Popups ~
------
- Support for transparency, see |popup-opacity|.
+- 'previewpopup' supports the same values as 'completepopup' (except for
+ "align").
Other ~
-----
-*windows.txt* For Vim version 9.2. Last change: 2026 Feb 14
+*windows.txt* For Vim version 9.2. Last change: 2026 Feb 24
VIM REFERENCE MANUAL by Bram Moolenaar
Alternatively, a popup window can be used by setting the 'previewpopup'
option. When set, it overrules the 'previewwindow' and 'previewheight'
settings. The option is a comma-separated list of values:
+ border border style (see 'pumborder')
+ borderhighlight highlight group for the popup border characters
+ close show close button: "on" (default) or "off", and if
+ the value is "on", it must be set after border.
height maximum height of the popup
- width maximum width of the popup
highlight highlight group of the popup (default is Pmenu)
+ resize show resize handle: "on" (default) or "off"
+ shadow "off" (default) or "on" using |hl-PmenuShadow|
+ width maximum width of the popup
+
Example: >
:set previewpopup=height:10,width:60
+ :set previewpopup=border:single,borderhilight:PmenuBorder
+ :set previewpopup=border:custom:─;│;─;│;┌;┐;┘;└
A few peculiarities:
- If the file is in a buffer already, it will be re-used. This will allow for
static char *(p_popup_cpp_option_values[]) = {"align:", "border:",
"borderhighlight:", "close:", "height:", "highlight:", "resize:",
"shadow:", "width:", NULL};
-static char *(p_popup_pvp_option_values[]) = {"height:", "highlight:",
- "width:", NULL};
+static char *(p_popup_pvp_option_values[]) = {"border:",
+ "borderhighlight:", "close:", "height:", "highlight:", "resize:",
+ "shadow:", "width:", NULL};
static char *(p_popup_option_on_off_values[]) = {"on", "off", NULL};
static char *(p_popup_cpp_border_values[]) = {"single", "double", "round",
"ascii", "on", "off", "custom:", NULL};
+static char *(p_popup_pvp_border_values[]) = {"single", "double", "round",
+ "ascii", "on", "off", "custom:", NULL};
static char *(p_popup_option_align_values[]) = {"item", "menu", NULL};
#endif
#if defined(FEAT_SPELL)
if (parse_previewpopup(NULL) == FAIL)
return e_invalid_argument;
+ popup_close_info();
return NULL;
}
{
return expand_set_opt_string(
args,
- previewpopup ? p_popup_option_on_off_values
+ previewpopup ? p_popup_pvp_border_values
: p_popup_cpp_border_values,
- (previewpopup ? ARRAY_LENGTH(p_popup_option_on_off_values)
+ (previewpopup ? ARRAY_LENGTH(p_popup_pvp_border_values) - 1
: ARRAY_LENGTH(p_popup_cpp_border_values)) - 1,
numMatches,
matches);
int on = STRNCMP(arg, "on", 2) == 0 && arg + 2 == p;
int off = STRNCMP(arg, "off", 3) == 0 && arg + 3 == p;
- if ((!on && !off) || is_preview)
+ if (!on && !off)
return FAIL;
- on = on && mouse_has(MOUSE_INSERT) && border_enabled;
+ on = on && mouse_has(MOUSE_INSERT) && (border_enabled || is_preview);
if (wp != NULL)
wp->w_popup_close = on ? POPCLOSE_BUTTON : POPCLOSE_NONE;
}
int on = STRNCMP(arg, "on", 2) == 0 && arg + 2 == p;
int off = STRNCMP(arg, "off", 3) == 0 && arg + 3 == p;
- if ((!on && !off) || is_preview)
+ if (!on && !off)
return FAIL;
if (wp != NULL)
{
int on = STRNCMP(arg, "on", 2) == 0 && arg + 2 == p;
int off = STRNCMP(arg, "off", 3) == 0 && arg + 3 == p;
- if ((!on && !off) || is_preview)
+ if (!on && !off)
return FAIL;
if (wp != NULL)
wp->w_popup_shadow = on ? 1 : 0;
wp->w_popup_flags |= POPF_CURSORLINE;
}
+ for (i = 0; i < 4; ++i)
+ VIM_CLEAR(wp->w_border_highlight[i]);
+ for (i = 0; i < 8; ++i)
+ wp->w_border_char[i] = 0;
+
if (type == TYPE_PREVIEW)
{
- wp->w_popup_flags |= POPF_DRAG | POPF_RESIZE;
- wp->w_popup_close = POPCLOSE_BUTTON;
+ if (mouse_has(MOUSE_INSERT))
+ {
+ wp->w_popup_flags |= POPF_DRAG | POPF_RESIZE;
+ wp->w_popup_close = POPCLOSE_BUTTON;
+ }
for (i = 0; i < 4; ++i)
wp->w_popup_border[i] = 1;
parse_previewpopup(wp);
popup_set_wantpos_cursor(wp, wp->w_minwidth, d);
}
- for (i = 0; i < 4; ++i)
- VIM_CLEAR(wp->w_border_highlight[i]);
- for (i = 0; i < 8; ++i)
- wp->w_border_char[i] = 0;
-
#ifdef FEAT_QUICKFIX
if (type == TYPE_INFO)
{
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|┌+0#0000001#ffd7ff255| |X|p@1|f|i|l|e| |─@31|X| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|│+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|└+0#0000001#ffd7ff255|─@40|┘| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|╔+0#0000001#ffd7ff255| |X|p@1|f|i|l|e| |═@31|X| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|╚+0#0000001#ffd7ff255|═@40|╝| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|╭+0#0000001#ffd7ff255| |X|p@1|f|i|l|e| |─@31|X| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|│+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|╰+0#0000001#ffd7ff255|─@40|╯| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|++0#0000001#ffd7ff255| |X|p@1|f|i|l|e| |-@31|X| +0#0000000#ffffff0@31
+||+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001||+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+||+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255||+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+||+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255||+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+||+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255||+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|++0#0000001#ffd7ff255|-@40|+| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|┌+0&#afffff255| |X|p@1|f|i|l|e| |─@31|X| +0&#ffffff0@31
+|│+0&#afffff255|1+0#0000001#ffd7ff255| @38| +0#0000000#0000001|│+0&#afffff255| +0&#ffffff0@31
+|│+0&#afffff255|2+0#0000001#ffd7ff255| @38| +0#0000000#a8a8a8255|│+0&#afffff255| +0#4040ff13#ffffff0@31
+|│+0#0000000#afffff255|3+0#0000001#ffd7ff255| @38| +0#0000000#a8a8a8255|│+0&#afffff255| +0#4040ff13#ffffff0@31
+|│+0#0000000#afffff255|4+0#0000001#ffd7ff255| @38| +0#0000000#a8a8a8255|│+0&#afffff255| +0#4040ff13#ffffff0@31
+|└+0#0000000#afffff255|─@40|┘| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|╔+0&#afffff255| |X|p@1|f|i|l|e| |═@31|X| +0&#ffffff0@31
+|║+0&#afffff255|1+0#0000001#ffd7ff255| @38| +0#0000000#0000001|║+0&#afffff255| +0&#ffffff0@31
+|║+0&#afffff255|2+0#0000001#ffd7ff255| @38| +0#0000000#a8a8a8255|║+0&#afffff255| +0#4040ff13#ffffff0@31
+|║+0#0000000#afffff255|3+0#0000001#ffd7ff255| @38| +0#0000000#a8a8a8255|║+0&#afffff255| +0#4040ff13#ffffff0@31
+|║+0#0000000#afffff255|4+0#0000001#ffd7ff255| @38| +0#0000000#a8a8a8255|║+0&#afffff255| +0#4040ff13#ffffff0@31
+|╚+0#0000000#afffff255|═@40|⇲| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+| +0#0000001#ffd7ff255@1|X|p@1|f|i|l|e| @31| +0#0000000#ffffff0@33
+|1+0#0000001#ffd7ff255| @38| +0#0000000#0000001| +0&#ffffff0@33
+|2+0#0000001#ffd7ff255| @38| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@33
+|3+0#0000001#ffd7ff255| @38| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@33
+|4+0#0000001#ffd7ff255| @38| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@33
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|╔+0#0000001#ffd7ff255| |X|p@1|M|o|u|s|e|f|i|l|e| |═@26|╗| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|╚+0#0000001#ffd7ff255|═@40|╝| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|╔+0#0000001#ffd7ff255| |X|p@1|M|o|u|s|e|f|i|l|e| |═@26|X| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|╚+0#0000001#ffd7ff255|═@40|⇲| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|╔+0#0000001#ffd7ff255| |X|p@1|M|o|u|s|e|f|i|l|e| |═@26|X| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|╚+0#0000001#ffd7ff255|═@40|╝| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|╔+0#0000001#ffd7ff255| |X|p@1|M|o|u|s|e|f|i|l|e| |═@26|╗| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|╚+0#0000001#ffd7ff255|═@40|⇲| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|┌+0#0000001#ffd7ff255| |X|p@1|M|o|u|s|e|f|i|l|e| |─@26|┐| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|│+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|└+0#0000001#ffd7ff255|─@40|┘| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|┌+0#0000001#ffd7ff255| |X|p@1|M|o|u|s|e|f|i|l|e| |─@26|X| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|│+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|└+0#0000001#ffd7ff255|─@40|┘| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|┌+0#0000001#ffd7ff255| |X|p@1|M|o|u|s|e|f|i|l|e| |─@26|┐| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|│+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|│+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|│+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|│+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|└+0#0000001#ffd7ff255|─@40|┘| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|╔+0#0000001#ffd7ff255| |X|p@1|S|h|a|d|o|w|f|i|l|e| |═@25|X| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#6c6c6c255#0000001@1| +0#0000000#ffffff0@29
+|║+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#6c6c6c255#0000001@1| +0#4040ff13#ffffff0@29
+|║+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#6c6c6c255#0000001@1| +0#4040ff13#ffffff0@29
+|║+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#6c6c6c255#0000001@1| +0#4040ff13#ffffff0@29
+|╚+0#0000001#ffd7ff255|═@40|⇲| +0#6c6c6c255#0000001@1| +0#4040ff13#ffffff0@29
+|~| | +0#6c6c6c255#0000001@42| +0#4040ff13#ffffff0@29
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
--- /dev/null
+>o+0&#ffffff0|n|e| @71
+|╔+0#0000001#ffd7ff255| |X|p@1|S|h|a|d|o|w|f|i|l|e| |═@25|X| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|1| @38| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@31
+|║+0#0000001#ffd7ff255|2| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|3| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|║+0#0000001#ffd7ff255|4| @38| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@31
+|╚+0#0000001#ffd7ff255|═@40|⇲| +0#4040ff13#ffffff0@31
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|:+0#0000000&| @55|1|,|1| @10|A|l@1|
set keyprotocol&
" previewpopup / completepopup
- call assert_equal('height:', getcompletion('set previewpopup=', 'cmdline')[0])
+ call assert_equal('border:', getcompletion('set previewpopup=', 'cmdline')[0])
call assert_equal('EndOfBuffer', getcompletion('set previewpopup=highlight:End*Buffer', 'cmdline')[0])
call feedkeys(":set previewpopup+=border:\<Tab>\<C-B>\"\<CR>", 'xt')
- call assert_equal('"set previewpopup+=border:on', @:)
+ call assert_equal('"set previewpopup+=border:single', @:)
call feedkeys(":set completepopup=height:10,align:\<Tab>\<C-B>\"\<CR>", 'xt')
call assert_equal('"set completepopup=height:10,align:item', @:)
call assert_equal([], getcompletion('set completepopup=bogusname:', 'cmdline'))
call s:run_preview_popuppum(lines, 'pbuffer')
endfunc
+func Test_previewpopup_border()
+ CheckScreendump
+ CheckFeature quickfix
+ call writefile(range(1, 20), 'Xppfile', 'D')
+
+ let lines =<< trim END
+ call setline(1, ['one', 'two', 'three'])
+ hi BorderColor ctermbg=lightcyan guibg=lightcyan
+ END
+ call writefile(lines, 'XtestPPBorder', 'D')
+ let buf = RunVimInTerminal('-S XtestPPBorder', #{rows: 14})
+ call TermWait(buf, 25)
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:single\<CR>")
+ call term_sendkeys(buf, ":pedit Xppfile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_1', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:double\<CR>")
+ call term_sendkeys(buf, ":pedit Xppfile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_2', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:round\<CR>")
+ call term_sendkeys(buf, ":pedit Xppfile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_3', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:ascii\<CR>")
+ call term_sendkeys(buf, ":pedit Xppfile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_4', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:single,borderhighlight:BorderColor\<CR>")
+ call term_sendkeys(buf, ":pedit Xppfile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_5', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:on,borderhighlight:BorderColor\<CR>")
+ call term_sendkeys(buf, ":pedit Xppfile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_6', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:off\<CR>")
+ call term_sendkeys(buf, ":pedit Xppfile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_7', {})
+ call StopVimInTerminal(buf)
+endfunc
+
+func Test_previewpopup_border_mouse()
+ CheckScreendump
+ CheckFeature quickfix
+
+ call writefile(range(1, 20), 'XppMousefile', 'D')
+
+ let lines =<< trim END
+ call setline(1, ['one', 'two', 'three'])
+ hi BorderColor ctermbg=lightcyan guibg=lightcyan
+ set mouse=
+ set previewpopup=height:4,width:40
+ END
+ call writefile(lines, 'XtestPPBorderMouse', 'D')
+ let buf = RunVimInTerminal('-S XtestPPBorderMouse', #{rows: 14})
+
+ call TermWait(buf, 25)
+ call term_sendkeys(buf, ":pedit XppMousefile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_mouse_1', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set mouse=a\<CR>:\<CR>")
+ call term_sendkeys(buf, ":pedit XppMousefile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_mouse_2', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,resize:off\<CR>")
+ call term_sendkeys(buf, ":pedit XppMousefile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_mouse_3', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,resize:on,close:off\<CR>")
+ call term_sendkeys(buf, ":pedit XppMousefile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_mouse_4', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:single,close:off\<CR>")
+ call term_sendkeys(buf, ":pedit XppMousefile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_mouse_5', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:single,close:on\<CR>")
+ call term_sendkeys(buf, ":pedit XppMousefile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_mouse_6', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,border:single,close:off\<CR>")
+ call term_sendkeys(buf, ":pedit XppMousefile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_border_mouse_7', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
+func Test_previewpopup_shadow()
+ CheckScreendump
+ CheckFeature quickfix
+
+ call writefile(range(1, 20), 'XppShadowfile', 'D')
+
+ let lines =<< trim END
+ call setline(1, ['one', 'two', 'three'])
+ hi BorderColor ctermbg=lightcyan guibg=lightcyan
+ END
+ call writefile(lines, 'XtestPPShadow', 'D')
+ let buf = RunVimInTerminal('-S XtestPPShadow', #{rows: 14})
+
+ call TermWait(buf, 25)
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,shadow:on\<CR>")
+ call term_sendkeys(buf, ":pedit XppShadowfile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_shadow_1', {})
+
+ call term_sendkeys(buf, ":pclose\<CR>")
+ call term_sendkeys(buf, ":set previewpopup=height:4,width:40,shadow:off\<CR>")
+ call term_sendkeys(buf, ":pedit XppShadowfile\<CR>:\<CR>")
+ call VerifyScreenDump(buf, 'Test_previewpopup_shadow_2', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Get_popupmenu_lines()
let lines =<< trim END
set completeopt+=preview,popup
\ ['xxx']],
\ 'patchmode': [['', 'xxx', '.x'], [&backupext, '*']],
\ 'previewpopup': [['', 'height:13', 'width:20', 'highlight:That',
- \ 'align:item', 'align:menu', 'border:on', 'border:off',
+ \ 'border:on', 'border:off', 'border:round', 'border:single',
+ \ 'border:double', 'border:ascii', 'close:on', 'close:off',
+ \ 'resize:on', 'resize:off', 'shadow:on', 'shadow:off',
+ \ 'borderhighlight:Title',
\ 'width:10,height:234,highlight:Mine'],
\ ['xxx', 'xxx:99', 'height:yes', 'width:no', 'align:xxx',
- \ 'border:maybe', 'border:1', 'border:']],
+ \ 'border:maybe', 'border:1', 'border:', 'resize:xxx', 'close:xxx',
+ \ 'shadow:xxx']],
\ 'printmbfont': [['', 'r:some', 'b:some', 'i:some', 'o:some', 'c:yes',
\ 'c:no', 'a:yes', 'a:no', 'b:Bold,c:yes'],
\ ['xxx', 'xxx,c:yes', 'xxx:', 'xxx:,c:yes']],
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 51,
/**/
50,
/**/