patch 9.2.0051: 'previewpopup' is missing features available in 'completepopup'

Problem:  The 'previewpopup' option lacks several customization values
          that 'completepopup' supports, such as borders, shadows,
          and UI handles.
Solution: Add support for "border", "borderhighlight", "close",
          "resize", and "shadow" to 'previewpopup' (Arkissa)

closes: #18873

Signed-off-by: Arkissa <mrarkssac@gmail.com>
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Arkissa
2026-02-24 21:45:22 +00:00
committed by Christian Brabandt
parent c4a6fa3ead
commit 6eb0bfd5bb
24 changed files with 395 additions and 21 deletions
+2
View File
@@ -52585,6 +52585,8 @@ work in progress.
Popups ~
------
- Support for transparency, see |popup-opacity|.
- 'previewpopup' supports the same values as 'completepopup' (except for
"align").
Other ~
-----
+11 -2
View File
@@ -1,4 +1,4 @@
*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
@@ -954,11 +954,20 @@ windows.
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
+8 -4
View File
@@ -75,11 +75,14 @@ static char *(p_kpc_protocol_values[]) = {"none", "mok2", "kitty", NULL};
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)
@@ -3415,6 +3418,7 @@ did_set_previewpopup(optset_T *args UNUSED)
if (parse_previewpopup(NULL) == FAIL)
return e_invalid_argument;
popup_close_info();
return NULL;
}
@@ -3452,9 +3456,9 @@ expand_set_popupoption(optexpand_T *args, int *numMatches, char_u ***matches,
{
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);
+14 -11
View File
@@ -2006,9 +2006,9 @@ parse_popup_option(win_T *wp, int is_preview)
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;
}
@@ -2018,7 +2018,7 @@ parse_popup_option(win_T *wp, int is_preview)
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)
{
@@ -2034,7 +2034,7 @@ parse_popup_option(win_T *wp, int is_preview)
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;
@@ -2457,21 +2457,24 @@ popup_create(typval_T *argvars, typval_T *rettv, create_type_T type)
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)
{
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
@@ -0,0 +1,14 @@
>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|
+2 -2
View File
@@ -643,10 +643,10 @@ func Test_set_completion_string_values()
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'))
+126
View File
@@ -3523,6 +3523,132 @@ func Test_previewpopup_pum_pbuffer()
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
+6 -2
View File
@@ -272,10 +272,14 @@ let test_values = {
\ ['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']],
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
51,
/**/
50,
/**/