mirror of
https://github.com/vim/vim.git
synced 2025-10-16 07:24:23 -04:00
patch 8.1.1882: cannot specify properties of the info popup window
Problem: Cannot specify properties of the info popup window. Solution: Add the 'completepopup' option. Default to PmenuSel highlight.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
*insert.txt* For Vim version 8.1. Last change: 2019 May 07
|
*insert.txt* For Vim version 8.1. Last change: 2019 Aug 18
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -1092,7 +1092,7 @@ items:
|
|||||||
menu extra text for the popup menu, displayed after "word"
|
menu extra text for the popup menu, displayed after "word"
|
||||||
or "abbr"
|
or "abbr"
|
||||||
info more information about the item, can be displayed in a
|
info more information about the item, can be displayed in a
|
||||||
preview window
|
preview or popup window
|
||||||
kind single letter indicating the type of completion
|
kind single letter indicating the type of completion
|
||||||
icase when non-zero case is to be ignored when comparing
|
icase when non-zero case is to be ignored when comparing
|
||||||
items to be equal; when omitted zero is used, thus
|
items to be equal; when omitted zero is used, thus
|
||||||
@@ -1114,11 +1114,22 @@ items in the returned list.
|
|||||||
|
|
||||||
The "menu" item is used in the popup menu and may be truncated, thus it should
|
The "menu" item is used in the popup menu and may be truncated, thus it should
|
||||||
be relatively short. The "info" item can be longer, it will be displayed in
|
be relatively short. The "info" item can be longer, it will be displayed in
|
||||||
the preview window when "preview" appears in 'completeopt'. The "info" item
|
the preview window when "preview" appears in 'completeopt' or in a popup
|
||||||
will also remain displayed after the popup menu has been removed. This is
|
window when "popup" appears in 'completeopt'. In the preview window the
|
||||||
useful for function arguments. Use a single space for "info" to remove
|
"info" item will also remain displayed after the popup menu has been removed.
|
||||||
existing text in the preview window. The size of the preview window is three
|
This is useful for function arguments. Use a single space for "info" to
|
||||||
lines, but 'previewheight' is used when it has a value of 1 or 2.
|
remove existing text in the preview window. The size of the preview window is
|
||||||
|
three lines, but 'previewheight' is used when it has a value of 1 or 2.
|
||||||
|
|
||||||
|
*complete-popup*
|
||||||
|
When "popup" is in 'completeopt' a popup window is used to display the "info".
|
||||||
|
Then the 'completepopup' option specifies the properties of the popup. The
|
||||||
|
option is a comma separated list of values:
|
||||||
|
height maximum height of the popup
|
||||||
|
width maximum width of the popup
|
||||||
|
highlight highlight group of the popup (default is Pmenu)
|
||||||
|
Example: >
|
||||||
|
:set completepopup=height:10,width:60,highlight:InfoPopup
|
||||||
|
|
||||||
The "kind" item uses a single letter to indicate the kind of completion. This
|
The "kind" item uses a single letter to indicate the kind of completion. This
|
||||||
may be used to show the completion differently (different color or icon).
|
may be used to show the completion differently (different color or icon).
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
*options.txt* For Vim version 8.1. Last change: 2019 Aug 17
|
*options.txt* For Vim version 8.1. Last change: 2019 Aug 18
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -1918,6 +1918,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
popup Show extra information about the currently selected
|
popup Show extra information about the currently selected
|
||||||
completion in a popup window. Only works in combination
|
completion in a popup window. Only works in combination
|
||||||
with "menu" or "menuone". Overrides "preview".
|
with "menu" or "menuone". Overrides "preview".
|
||||||
|
See |'completepopup'| for specifying properties.
|
||||||
{only works when compiled with the +textprop feature}
|
{only works when compiled with the +textprop feature}
|
||||||
|
|
||||||
noinsert Do not insert any text for a match until the user selects
|
noinsert Do not insert any text for a match until the user selects
|
||||||
@@ -1929,6 +1930,15 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
"menu" or "menuone".
|
"menu" or "menuone".
|
||||||
|
|
||||||
|
|
||||||
|
*'completepopup'* *'cpp'*
|
||||||
|
'completepopup' 'cpp' string (default empty)
|
||||||
|
global
|
||||||
|
{not available when compiled without the |+textprop|
|
||||||
|
or |+quickfix| feature}
|
||||||
|
When 'completeopt' contains "popup" then this option is used for the
|
||||||
|
properties of the info popup. See |complete-popup|.
|
||||||
|
|
||||||
|
|
||||||
*'concealcursor'* *'cocu'*
|
*'concealcursor'* *'cocu'*
|
||||||
'concealcursor' 'cocu' string (default: "")
|
'concealcursor' 'cocu' string (default: "")
|
||||||
local to window
|
local to window
|
||||||
@@ -3160,8 +3170,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'fillchars'* *'fcs'*
|
*'fillchars'* *'fcs'*
|
||||||
'fillchars' 'fcs' string (default "vert:|,fold:-")
|
'fillchars' 'fcs' string (default "vert:|,fold:-")
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows|
|
{not available when compiled without the |+folding|
|
||||||
and |+folding| features}
|
feature}
|
||||||
Characters to fill the statuslines and vertical separators.
|
Characters to fill the statuslines and vertical separators.
|
||||||
It is a comma separated list of items:
|
It is a comma separated list of items:
|
||||||
|
|
||||||
@@ -3797,8 +3807,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'guitablabel'* *'gtl'*
|
*'guitablabel'* *'gtl'*
|
||||||
'guitablabel' 'gtl' string (default empty)
|
'guitablabel' 'gtl' string (default empty)
|
||||||
global
|
global
|
||||||
{only available when compiled with GUI enabled and
|
{only available when compiled with GUI enabled}
|
||||||
with the |+windows| feature}
|
|
||||||
When nonempty describes the text to use in a label of the GUI tab
|
When nonempty describes the text to use in a label of the GUI tab
|
||||||
pages line. When empty and when the result is empty Vim will use a
|
pages line. When empty and when the result is empty Vim will use a
|
||||||
default label. See |setting-guitablabel| for more info.
|
default label. See |setting-guitablabel| for more info.
|
||||||
@@ -3816,8 +3825,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'guitabtooltip'* *'gtt'*
|
*'guitabtooltip'* *'gtt'*
|
||||||
'guitabtooltip' 'gtt' string (default empty)
|
'guitabtooltip' 'gtt' string (default empty)
|
||||||
global
|
global
|
||||||
{only available when compiled with GUI enabled and
|
{only available when compiled with GUI enabled}
|
||||||
with the |+windows| feature}
|
|
||||||
When nonempty describes the text to use in a tooltip for the GUI tab
|
When nonempty describes the text to use in a tooltip for the GUI tab
|
||||||
pages line. When empty Vim will use a default tooltip.
|
pages line. When empty Vim will use a default tooltip.
|
||||||
This option is otherwise just like 'guitablabel' above.
|
This option is otherwise just like 'guitablabel' above.
|
||||||
@@ -3842,8 +3850,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'helpheight'* *'hh'*
|
*'helpheight'* *'hh'*
|
||||||
'helpheight' 'hh' number (default 20)
|
'helpheight' 'hh' number (default 20)
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows|
|
|
||||||
feature}
|
|
||||||
Minimal initial height of the help window when it is opened with the
|
Minimal initial height of the help window when it is opened with the
|
||||||
":help" command. The initial height of the help window is half of the
|
":help" command. The initial height of the help window is half of the
|
||||||
current window, or (when the 'ea' option is on) the same as other
|
current window, or (when the 'ea' option is on) the same as other
|
||||||
@@ -5642,8 +5648,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'previewheight'* *'pvh'*
|
*'previewheight'* *'pvh'*
|
||||||
'previewheight' 'pvh' number (default 12)
|
'previewheight' 'pvh' number (default 12)
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows| or
|
{not available when compiled without the |+quickfix|
|
||||||
|+quickfix| features}
|
feature}
|
||||||
Default height for a preview window. Used for |:ptag| and associated
|
Default height for a preview window. Used for |:ptag| and associated
|
||||||
commands. Used for |CTRL-W_}| when no count is given. Not used when
|
commands. Used for |CTRL-W_}| when no count is given. Not used when
|
||||||
'previewpopup' is set.
|
'previewpopup' is set.
|
||||||
@@ -5651,8 +5657,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'previewpopup'* *'pvp'*
|
*'previewpopup'* *'pvp'*
|
||||||
'previewpopup' 'pvp' string (default empty)
|
'previewpopup' 'pvp' string (default empty)
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows|,
|
{not available when compiled without the |+textprop|
|
||||||
|+textprop| or |+quickfix| feature}
|
or |+quickfix| feature}
|
||||||
When not empty a popup window is used for commands that would open a
|
When not empty a popup window is used for commands that would open a
|
||||||
preview window. See |preview-popup|.
|
preview window. See |preview-popup|.
|
||||||
Not used for the insert completion info, add "popup" to
|
Not used for the insert completion info, add "popup" to
|
||||||
@@ -5662,8 +5668,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'pvw'* *'nopvw'* *E590*
|
*'pvw'* *'nopvw'* *E590*
|
||||||
'previewwindow' 'pvw' boolean (default off)
|
'previewwindow' 'pvw' boolean (default off)
|
||||||
local to window
|
local to window
|
||||||
{not available when compiled without the |+windows| or
|
{not available when compiled without the |+quickfix|
|
||||||
|+quickfix| features}
|
feature}
|
||||||
Identifies the preview window. Only one window can have this option
|
Identifies the preview window. Only one window can have this option
|
||||||
set. It's normally not set directly, but by using one of the commands
|
set. It's normally not set directly, but by using one of the commands
|
||||||
|:ptag|, |:pedit|, etc.
|
|:ptag|, |:pedit|, etc.
|
||||||
@@ -6781,8 +6787,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'showtabline'* *'stal'*
|
*'showtabline'* *'stal'*
|
||||||
'showtabline' 'stal' number (default 1)
|
'showtabline' 'stal' number (default 1)
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows|
|
|
||||||
feature}
|
|
||||||
The value of this option specifies when the line with tab page labels
|
The value of this option specifies when the line with tab page labels
|
||||||
will be displayed:
|
will be displayed:
|
||||||
0: never
|
0: never
|
||||||
@@ -7079,8 +7083,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'splitbelow'* *'sb'* *'nosplitbelow'* *'nosb'*
|
*'splitbelow'* *'sb'* *'nosplitbelow'* *'nosb'*
|
||||||
'splitbelow' 'sb' boolean (default off)
|
'splitbelow' 'sb' boolean (default off)
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows|
|
|
||||||
feature}
|
|
||||||
When on, splitting a window will put the new window below the current
|
When on, splitting a window will put the new window below the current
|
||||||
one. |:split|
|
one. |:split|
|
||||||
|
|
||||||
@@ -7401,8 +7403,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'tabline'* *'tal'*
|
*'tabline'* *'tal'*
|
||||||
'tabline' 'tal' string (default empty)
|
'tabline' 'tal' string (default empty)
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows|
|
|
||||||
feature}
|
|
||||||
When nonempty, this option determines the content of the tab pages
|
When nonempty, this option determines the content of the tab pages
|
||||||
line at the top of the Vim window. When empty Vim will use a default
|
line at the top of the Vim window. When empty Vim will use a default
|
||||||
tab pages line. See |setting-tabline| for more info.
|
tab pages line. See |setting-tabline| for more info.
|
||||||
@@ -7428,8 +7428,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'tabpagemax'* *'tpm'*
|
*'tabpagemax'* *'tpm'*
|
||||||
'tabpagemax' 'tpm' number (default 10)
|
'tabpagemax' 'tpm' number (default 10)
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows|
|
|
||||||
feature}
|
|
||||||
Maximum number of tab pages to be opened by the |-p| command line
|
Maximum number of tab pages to be opened by the |-p| command line
|
||||||
argument or the ":tab all" command. |tabpage|
|
argument or the ":tab all" command. |tabpage|
|
||||||
|
|
||||||
@@ -8739,8 +8737,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'winheight'* *'wh'* *E591*
|
*'winheight'* *'wh'* *E591*
|
||||||
'winheight' 'wh' number (default 1)
|
'winheight' 'wh' number (default 1)
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows|
|
|
||||||
feature}
|
|
||||||
Minimal number of lines for the current window. This is not a hard
|
Minimal number of lines for the current window. This is not a hard
|
||||||
minimum, Vim will use fewer lines if there is not enough room. If the
|
minimum, Vim will use fewer lines if there is not enough room. If the
|
||||||
focus goes to a window that is smaller, its size is increased, at the
|
focus goes to a window that is smaller, its size is increased, at the
|
||||||
@@ -8761,8 +8757,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'*
|
*'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'*
|
||||||
'winfixheight' 'wfh' boolean (default off)
|
'winfixheight' 'wfh' boolean (default off)
|
||||||
local to window
|
local to window
|
||||||
{not available when compiled without the |+windows|
|
|
||||||
feature}
|
|
||||||
Keep the window height when windows are opened or closed and
|
Keep the window height when windows are opened or closed and
|
||||||
'equalalways' is set. Also for |CTRL-W_=|. Set by default for the
|
'equalalways' is set. Also for |CTRL-W_=|. Set by default for the
|
||||||
|preview-window| and |quickfix-window|.
|
|preview-window| and |quickfix-window|.
|
||||||
@@ -8771,8 +8765,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'winfixwidth'* *'wfw'* *'nowinfixwidth'* *'nowfw'*
|
*'winfixwidth'* *'wfw'* *'nowinfixwidth'* *'nowfw'*
|
||||||
'winfixwidth' 'wfw' boolean (default off)
|
'winfixwidth' 'wfw' boolean (default off)
|
||||||
local to window
|
local to window
|
||||||
{not available when compiled without the |+windows|
|
|
||||||
feature}
|
|
||||||
Keep the window width when windows are opened or closed and
|
Keep the window width when windows are opened or closed and
|
||||||
'equalalways' is set. Also for |CTRL-W_=|.
|
'equalalways' is set. Also for |CTRL-W_=|.
|
||||||
The width may be changed anyway when running out of room.
|
The width may be changed anyway when running out of room.
|
||||||
@@ -8780,8 +8772,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'winminheight'* *'wmh'*
|
*'winminheight'* *'wmh'*
|
||||||
'winminheight' 'wmh' number (default 1)
|
'winminheight' 'wmh' number (default 1)
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+windows|
|
|
||||||
feature}
|
|
||||||
The minimal height of a window, when it's not the current window.
|
The minimal height of a window, when it's not the current window.
|
||||||
This is a hard minimum, windows will never become smaller.
|
This is a hard minimum, windows will never become smaller.
|
||||||
When set to zero, windows may be "squashed" to zero lines (i.e. just a
|
When set to zero, windows may be "squashed" to zero lines (i.e. just a
|
||||||
|
15
src/option.c
15
src/option.c
@@ -891,6 +891,15 @@ static struct vimoption options[] =
|
|||||||
#else
|
#else
|
||||||
(char_u *)NULL, PV_NONE,
|
(char_u *)NULL, PV_NONE,
|
||||||
{(char_u *)0L, (char_u *)0L}
|
{(char_u *)0L, (char_u *)0L}
|
||||||
|
#endif
|
||||||
|
SCTX_INIT},
|
||||||
|
{"completepopup", "cpp", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
|
||||||
|
#ifdef FEAT_TEXT_PROP
|
||||||
|
(char_u *)&p_cpp, PV_NONE,
|
||||||
|
{(char_u *)"", (char_u *)0L}
|
||||||
|
#else
|
||||||
|
(char_u *)NULL, PV_NONE,
|
||||||
|
{(char_u *)NULL, (char_u *)0L}
|
||||||
#endif
|
#endif
|
||||||
SCTX_INIT},
|
SCTX_INIT},
|
||||||
{"completeslash", "csl", P_STRING|P_VI_DEF|P_VIM,
|
{"completeslash", "csl", P_STRING|P_VI_DEF|P_VIM,
|
||||||
@@ -7826,6 +7835,12 @@ did_set_string_option(
|
|||||||
if (parse_previewpopup(NULL) == FAIL)
|
if (parse_previewpopup(NULL) == FAIL)
|
||||||
errmsg = e_invarg;
|
errmsg = e_invarg;
|
||||||
}
|
}
|
||||||
|
// 'completepopup'
|
||||||
|
else if (varp == &p_cpp)
|
||||||
|
{
|
||||||
|
if (parse_completepopup(NULL) == FAIL)
|
||||||
|
errmsg = e_invarg;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Options that are a list of flags. */
|
/* Options that are a list of flags. */
|
||||||
|
@@ -503,6 +503,7 @@ EXTERN int p_fs; // 'fsync'
|
|||||||
#endif
|
#endif
|
||||||
EXTERN int p_gd; // 'gdefault'
|
EXTERN int p_gd; // 'gdefault'
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_TEXT_PROP
|
||||||
|
EXTERN char_u *p_cpp; // 'completepopup'
|
||||||
EXTERN char_u *p_pvp; // 'previewpopup'
|
EXTERN char_u *p_pvp; // 'previewpopup'
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_PRINTER
|
#ifdef FEAT_PRINTER
|
||||||
|
@@ -550,8 +550,7 @@ popup_highlight_curline(win_T *wp)
|
|||||||
|
|
||||||
if (syn_name2id((char_u *)linehl) == 0)
|
if (syn_name2id((char_u *)linehl) == 0)
|
||||||
linehl = "PmenuSel";
|
linehl = "PmenuSel";
|
||||||
sign_define_by_name(sign_name, NULL,
|
sign_define_by_name(sign_name, NULL, (char_u *)linehl, NULL, NULL);
|
||||||
(char_u *)linehl, NULL, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sign_place(&sign_id, (char_u *)"popupmenu", sign_name,
|
sign_place(&sign_id, (char_u *)"popupmenu", sign_name,
|
||||||
@@ -1286,16 +1285,16 @@ popup_set_buffer_text(buf_T *buf, typval_T text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse the 'previewpopup' option and apply the values to window "wp" if it
|
* Parse the 'previewpopup' or 'completepopup' option and apply the values to
|
||||||
* not NULL.
|
* window "wp" if it is not NULL.
|
||||||
* Return FAIL if the parsing fails.
|
* Return FAIL if the parsing fails.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
parse_previewpopup(win_T *wp)
|
parse_popup_option(win_T *wp, int is_preview)
|
||||||
{
|
{
|
||||||
char_u *p;
|
char_u *p;
|
||||||
|
|
||||||
for (p = p_pvp; *p != NUL; p += (*p == ',' ? 1 : 0))
|
for (p = is_preview ? p_pvp : p_cpp; *p != NUL; p += (*p == ',' ? 1 : 0))
|
||||||
{
|
{
|
||||||
char_u *e, *dig;
|
char_u *e, *dig;
|
||||||
char_u *s = p;
|
char_u *s = p;
|
||||||
@@ -1310,31 +1309,69 @@ parse_previewpopup(win_T *wp)
|
|||||||
p = e + STRLEN(e);
|
p = e + STRLEN(e);
|
||||||
dig = e + 1;
|
dig = e + 1;
|
||||||
x = getdigits(&dig);
|
x = getdigits(&dig);
|
||||||
if (dig != p)
|
|
||||||
return FAIL;
|
|
||||||
|
|
||||||
if (STRNCMP(s, "height:", 7) == 0)
|
if (STRNCMP(s, "height:", 7) == 0)
|
||||||
{
|
{
|
||||||
|
if (dig != p)
|
||||||
|
return FAIL;
|
||||||
if (wp != NULL)
|
if (wp != NULL)
|
||||||
{
|
{
|
||||||
wp->w_minheight = x;
|
if (is_preview)
|
||||||
|
wp->w_minheight = x;
|
||||||
wp->w_maxheight = x;
|
wp->w_maxheight = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (STRNCMP(s, "width:", 6) == 0)
|
else if (STRNCMP(s, "width:", 6) == 0)
|
||||||
{
|
{
|
||||||
|
if (dig != p)
|
||||||
|
return FAIL;
|
||||||
if (wp != NULL)
|
if (wp != NULL)
|
||||||
{
|
{
|
||||||
wp->w_minwidth = x;
|
if (is_preview)
|
||||||
|
wp->w_minwidth = x;
|
||||||
wp->w_maxwidth = x;
|
wp->w_maxwidth = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (STRNCMP(s, "highlight:", 10) == 0)
|
||||||
|
{
|
||||||
|
if (wp != NULL)
|
||||||
|
{
|
||||||
|
int c = *p;
|
||||||
|
|
||||||
|
*p = NUL;
|
||||||
|
set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1,
|
||||||
|
s + 10, OPT_FREE|OPT_LOCAL, 0);
|
||||||
|
*p = c;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Parse the 'previewpopup' option and apply the values to window "wp" if it
|
||||||
|
* is not NULL.
|
||||||
|
* Return FAIL if the parsing fails.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
parse_previewpopup(win_T *wp)
|
||||||
|
{
|
||||||
|
return parse_popup_option(wp, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Parse the 'completepopup' option and apply the values to window "wp" if it
|
||||||
|
* is not NULL.
|
||||||
|
* Return FAIL if the parsing fails.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
parse_completepopup(win_T *wp)
|
||||||
|
{
|
||||||
|
return parse_popup_option(wp, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set w_wantline and w_wantcol for the cursor position in the current window.
|
* Set w_wantline and w_wantcol for the cursor position in the current window.
|
||||||
* Keep at least "width" columns from the right of the screen.
|
* Keep at least "width" columns from the right of the screen.
|
||||||
@@ -1641,6 +1678,7 @@ popup_create(typval_T *argvars, typval_T *rettv, create_type_T type)
|
|||||||
wp->w_popup_flags |= POPF_DRAG | POPF_RESIZE;
|
wp->w_popup_flags |= POPF_DRAG | POPF_RESIZE;
|
||||||
wp->w_popup_close = POPCLOSE_BUTTON;
|
wp->w_popup_close = POPCLOSE_BUTTON;
|
||||||
add_border_left_right_padding(wp);
|
add_border_left_right_padding(wp);
|
||||||
|
parse_completepopup(wp);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
|
@@ -11,6 +11,7 @@ int popup_width(win_T *wp);
|
|||||||
int popup_extra_width(win_T *wp);
|
int popup_extra_width(win_T *wp);
|
||||||
void popup_adjust_position(win_T *wp);
|
void popup_adjust_position(win_T *wp);
|
||||||
int parse_previewpopup(win_T *wp);
|
int parse_previewpopup(win_T *wp);
|
||||||
|
int parse_completepopup(win_T *wp);
|
||||||
void popup_set_wantpos_cursor(win_T *wp, int width);
|
void popup_set_wantpos_cursor(win_T *wp, int width);
|
||||||
void popup_set_wantpos_rowcol(win_T *wp, int row, int col);
|
void popup_set_wantpos_rowcol(win_T *wp, int row, int col);
|
||||||
void f_popup_clear(typval_T *argvars, typval_T *rettv);
|
void f_popup_clear(typval_T *argvars, typval_T *rettv);
|
||||||
|
@@ -996,7 +996,12 @@ get_wcr_attr(win_T *wp)
|
|||||||
wcr_attr = syn_name2attr(wp->w_p_wcr);
|
wcr_attr = syn_name2attr(wp->w_p_wcr);
|
||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_TEXT_PROP
|
||||||
else if (WIN_IS_POPUP(wp))
|
else if (WIN_IS_POPUP(wp))
|
||||||
wcr_attr = HL_ATTR(HLF_PNI);
|
{
|
||||||
|
if (wp->w_popup_flags & POPF_INFO)
|
||||||
|
wcr_attr = HL_ATTR(HLF_PSI); // PmenuSel
|
||||||
|
else
|
||||||
|
wcr_attr = HL_ATTR(HLF_PNI); // Pmenu
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return wcr_attr;
|
return wcr_attr;
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|a|w|o|r|d> @15|╔+0#0000001#ffd7ff255|═@15|X| +0#0000000#ffffff0@9
|
|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|a|w|o|r|d> @15|╔+0&#ffff4012|═@15|X| +0&#ffffff0@9
|
||||||
|~+0#4040ff13&| @23| +0#0000001#e0e0e08|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| |║+0&#ffd7ff255| |w|o|r|d|s| |a|r|e| |c|o@1|l| |║| +0#4040ff13#ffffff0@9
|
|~+0#4040ff13&| @23| +0#0000001#e0e0e08|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| |║+0#0000000#ffff4012| |w|o|r|d|s| |a|r|e| |c|o@1|l| |║| +0#4040ff13#ffffff0@9
|
||||||
|~| @23| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |╚|═@15|⇲| +0#4040ff13#ffffff0@9
|
|~| @23| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |╚+0#0000000#ffff4012|═@15|⇲| +0#4040ff13#ffffff0@9
|
||||||
|~| @23| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|
|~| @23| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|
||||||
|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|
|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|
||||||
|~| @73
|
|~| @73
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|a|n|o|t|h|e|r|w|o|r|d> @37
|
|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|a|n|o|t|h|e|r|w|o|r|d> @37
|
||||||
|~+0#4040ff13&| @23| +0#0000001#ffd7ff255|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| |╔|═@25|X
|
|~+0#4040ff13&| @23| +0#0000001#ffd7ff255|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| |╔+0#0000000#ffff4012|═@25|X
|
||||||
|~+0#4040ff13#ffffff0| @23| +0#0000001#e0e0e08|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |║+0&#ffd7ff255| |o|t|h|e|r| |w|o|r|d|s| |a|r|e| @9|║
|
|~+0#4040ff13#ffffff0| @23| +0#0000001#e0e0e08|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |║+0#0000000#ffff4012| |o|t|h|e|r| |w|o|r|d|s| |a|r|e| @9|║
|
||||||
|~+0#4040ff13#ffffff0| @23| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| |║| |c|o@1|l|e|r| |t|h|a|n| |t|h|i|s| |a|n|d| |s|o|m| |║
|
|~+0#4040ff13#ffffff0| @23| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| |║+0#0000000#ffff4012| |c|o@1|l|e|r| |t|h|a|n| |t|h|i|s| |a|n|d| |s|o|m| |║
|
||||||
|~+0#4040ff13#ffffff0| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |║| |e| |m|o|r|e| |t|e|x|t| @13|║
|
|~+0#4040ff13#ffffff0| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |║+0#0000000#ffff4012| |e| |m|o|r|e| |t|e|x|t| @13|║
|
||||||
|~+0#4040ff13#ffffff0| @45|║+0#0000001#ffd7ff255| |t|o| |m|a|k|e| |w|r|a|p| @12|║
|
|~+0#4040ff13#ffffff0| @45|║+0#0000000#ffff4012| |t|o| |m|a|k|e| |w|r|a|p| @12|║
|
||||||
|~+0#4040ff13#ffffff0| @45|╚+0#0000001#ffd7ff255|═@25|⇲
|
|~+0#4040ff13#ffffff0| @45|╚+0#0000000#ffff4012|═@25|⇲
|
||||||
|~+0#4040ff13#ffffff0| @73
|
|~+0#4040ff13#ffffff0| @73
|
||||||
|~| @73
|
|~| @73
|
||||||
|~| @73
|
|~| @73
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|n|o|i|n|f|o> @42
|
|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|n|o|i|n|f|o> @42
|
||||||
|~+0#4040ff13&| @23| +0#0000001#ffd7ff255|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|
|~+0#4040ff13&| @23| +0#0000001#ffd7ff255|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27
|
||||||
|~| @23| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |╔|═@14|X| +0#4040ff13#ffffff0@10
|
|~| @23| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |╔+0#0000000#ffff4012|═@11|X| +0#4040ff13#ffffff0@13
|
||||||
|~| @23| +0#0000001#e0e0e08|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| |║+0&#ffd7ff255| |n|o| |w|o|r|d|s| |h|e|r|e| |║| +0#4040ff13#ffffff0@10
|
|~| @23| +0#0000001#e0e0e08|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| |║+0#0000000#ffff4012| |l|e|t|s| @5| +0|║+0&#ffff4012| +0#4040ff13#ffffff0@13
|
||||||
|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |╚|═@14|⇲| +0#4040ff13#ffffff0@10
|
|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |║+0#0000000#ffff4012| |s|h|o|w| @5| +0|║+0&#ffff4012| +0#4040ff13#ffffff0@13
|
||||||
|~| @73
|
|~| @45|║+0#0000000#ffff4012| |a| @8| +0|║+0&#ffff4012| +0#4040ff13#ffffff0@13
|
||||||
|~| @73
|
|~| @45|║+0#0000000#ffff4012| |s|c|r|o|l@1|b|a|r| | +0&#a8a8a8255|║+0&#ffff4012| +0#4040ff13#ffffff0@13
|
||||||
|~| @73
|
|~| @45|╚+0#0000000#ffff4012|═@11|⇲| +0#4040ff13#ffffff0@13
|
||||||
|~| @73
|
|~| @73
|
||||||
|~| @73
|
|~| @73
|
||||||
|~| @73
|
|~| @73
|
||||||
|
@@ -2199,6 +2199,8 @@ func Test_popupmenu_info()
|
|||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
set completeopt+=preview,popup
|
set completeopt+=preview,popup
|
||||||
set completefunc=CompleteFuncDict
|
set completefunc=CompleteFuncDict
|
||||||
|
hi InfoPopup ctermbg=yellow
|
||||||
|
set completepopup=height:4,highlight:InfoPopup
|
||||||
|
|
||||||
func CompleteFuncDict(findstart, base)
|
func CompleteFuncDict(findstart, base)
|
||||||
if a:findstart
|
if a:findstart
|
||||||
@@ -2230,7 +2232,7 @@ func Test_popupmenu_info()
|
|||||||
\ 'word': 'noinfo',
|
\ 'word': 'noinfo',
|
||||||
\ 'abbr': 'noawrd',
|
\ 'abbr': 'noawrd',
|
||||||
\ 'menu': 'extra text',
|
\ 'menu': 'extra text',
|
||||||
\ 'info': 'no words here',
|
\ 'info': "lets\nshow\na\nscrollbar\nhere",
|
||||||
\ 'kind': 'W',
|
\ 'kind': 'W',
|
||||||
\ 'user_data': 'notest'
|
\ 'user_data': 'notest'
|
||||||
\ },
|
\ },
|
||||||
|
@@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1882,
|
||||||
/**/
|
/**/
|
||||||
1881,
|
1881,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user