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

1 view
Skip to first unread message

Christian Brabandt

unread,
5:01 PM (6 hours ago) 5:01 PM
to vim...@googlegroups.com
patch 9.2.0051: 'previewpopup' is missing features available in 'completepopup'

Commit: https://github.com/vim/vim/commit/6eb0bfd5bbf48ff4dc1d1bbf647dc6c9b96a6eed
Author: Arkissa <mrar...@gmail.com>
Date: Tue Feb 24 21:45:22 2026 +0000

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 <mrar...@gmail.com>
Signed-off-by: Girish Palya <giri...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index 5c35f3a84..6c8726696 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -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 ~
-----
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index af220e868..eee53cbdd 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -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
diff --git a/src/optionstr.c b/src/optionstr.c
index 9aead2124..3809b594a 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -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);
diff --git a/src/popupwin.c b/src/popupwin.c
index 380b884be..e7ab2687e 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -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)
{
diff --git a/src/testdir/dumps/Test_previewpopup_border_1.dump b/src/testdir/dumps/Test_previewpopup_border_1.dump
new file mode 100644
index 000000000..c99baafa0
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_1.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_2.dump b/src/testdir/dumps/Test_previewpopup_border_2.dump
new file mode 100644
index 000000000..4e818d19e
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_2.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_3.dump b/src/testdir/dumps/Test_previewpopup_border_3.dump
new file mode 100644
index 000000000..e544ced85
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_3.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_4.dump b/src/testdir/dumps/Test_previewpopup_border_4.dump
new file mode 100644
index 000000000..7e8e6ccf9
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_4.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_5.dump b/src/testdir/dumps/Test_previewpopup_border_5.dump
new file mode 100644
index 000000000..553f12c3b
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_5.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_6.dump b/src/testdir/dumps/Test_previewpopup_border_6.dump
new file mode 100644
index 000000000..eeb432c4f
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_6.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_7.dump b/src/testdir/dumps/Test_previewpopup_border_7.dump
new file mode 100644
index 000000000..7ad9417a2
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_7.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_mouse_1.dump b/src/testdir/dumps/Test_previewpopup_border_mouse_1.dump
new file mode 100644
index 000000000..f4477e6c8
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_mouse_1.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_mouse_2.dump b/src/testdir/dumps/Test_previewpopup_border_mouse_2.dump
new file mode 100644
index 000000000..1be1595a2
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_mouse_2.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_mouse_3.dump b/src/testdir/dumps/Test_previewpopup_border_mouse_3.dump
new file mode 100644
index 000000000..6b06be142
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_mouse_3.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_mouse_4.dump b/src/testdir/dumps/Test_previewpopup_border_mouse_4.dump
new file mode 100644
index 000000000..a36297f0c
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_mouse_4.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_mouse_5.dump b/src/testdir/dumps/Test_previewpopup_border_mouse_5.dump
new file mode 100644
index 000000000..92b7beb0c
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_mouse_5.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_mouse_6.dump b/src/testdir/dumps/Test_previewpopup_border_mouse_6.dump
new file mode 100644
index 000000000..8252a5c43
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_mouse_6.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_border_mouse_7.dump b/src/testdir/dumps/Test_previewpopup_border_mouse_7.dump
new file mode 100644
index 000000000..92b7beb0c
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_border_mouse_7.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_shadow_1.dump b/src/testdir/dumps/Test_previewpopup_shadow_1.dump
new file mode 100644
index 000000000..64efd962f
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_shadow_1.dump
@@ -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|
diff --git a/src/testdir/dumps/Test_previewpopup_shadow_2.dump b/src/testdir/dumps/Test_previewpopup_shadow_2.dump
new file mode 100644
index 000000000..f3ad04099
--- /dev/null
+++ b/src/testdir/dumps/Test_previewpopup_shadow_2.dump
@@ -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|
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index c6c83bb98..b2ca4d943 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -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'))
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index c00ac29a7..24d8fab57 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -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
diff --git a/src/testdir/util/gen_opt_test.vim b/src/testdir/util/gen_opt_test.vim
index 51ff726d3..7431122e1 100644
--- a/src/testdir/util/gen_opt_test.vim
+++ b/src/testdir/util/gen_opt_test.vim
@@ -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']],
diff --git a/src/version.c b/src/version.c
index 076063b4c..2d8094030 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 51,
/**/
50,
/**/
Reply all
Reply to author
Forward
0 new messages