patch 8.0.1495: having 'pumwidth' default to zero has no merit
Problem: Having 'pumwidth' default to zero has no merit. Solution: Make the default 15, as the actual default value.
This commit is contained in:
@ -2245,7 +2245,7 @@ static struct vimoption options[] =
|
|||||||
#else
|
#else
|
||||||
(char_u *)NULL, PV_NONE,
|
(char_u *)NULL, PV_NONE,
|
||||||
#endif
|
#endif
|
||||||
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
|
{(char_u *)15L, (char_u *)15L} SCRIPTID_INIT},
|
||||||
{"pythonthreedll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
{"pythonthreedll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
|
||||||
#if defined(DYNAMIC_PYTHON3)
|
#if defined(DYNAMIC_PYTHON3)
|
||||||
(char_u *)&p_py3dll, PV_NONE,
|
(char_u *)&p_py3dll, PV_NONE,
|
||||||
|
|||||||
@ -66,15 +66,6 @@ pum_compute_size(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Return the minimum width of the popup menu.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
pum_get_width(void)
|
|
||||||
{
|
|
||||||
return p_pw == 0 ? PUM_DEF_WIDTH : p_pw;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Show the popup menu with items "array[size]".
|
* Show the popup menu with items "array[size]".
|
||||||
* "array" must remain valid until pum_undisplay() is called!
|
* "array" must remain valid until pum_undisplay() is called!
|
||||||
@ -102,7 +93,7 @@ pum_display(
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
def_width = pum_get_width();
|
def_width = p_pw;
|
||||||
above_row = 0;
|
above_row = 0;
|
||||||
below_row = cmdline_row;
|
below_row = cmdline_row;
|
||||||
|
|
||||||
@ -225,10 +216,10 @@ pum_display(
|
|||||||
if (def_width < max_width)
|
if (def_width < max_width)
|
||||||
def_width = max_width;
|
def_width = max_width;
|
||||||
|
|
||||||
if (((col < Columns - pum_get_width() || col < Columns - max_width)
|
if (((col < Columns - p_pw || col < Columns - max_width)
|
||||||
#ifdef FEAT_RIGHTLEFT
|
#ifdef FEAT_RIGHTLEFT
|
||||||
&& !curwin->w_p_rl)
|
&& !curwin->w_p_rl)
|
||||||
|| (curwin->w_p_rl && (col > pum_get_width() || col > max_width)
|
|| (curwin->w_p_rl && (col > p_pw || col > max_width)
|
||||||
#endif
|
#endif
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
@ -244,17 +235,17 @@ pum_display(
|
|||||||
pum_width = Columns - pum_col - pum_scrollbar;
|
pum_width = Columns - pum_col - pum_scrollbar;
|
||||||
|
|
||||||
if (pum_width > max_width + pum_kind_width + pum_extra_width + 1
|
if (pum_width > max_width + pum_kind_width + pum_extra_width + 1
|
||||||
&& pum_width > pum_get_width())
|
&& pum_width > p_pw)
|
||||||
{
|
{
|
||||||
/* the width is too much, make it narrower */
|
/* the width is too much, make it narrower */
|
||||||
pum_width = max_width + pum_kind_width + pum_extra_width + 1;
|
pum_width = max_width + pum_kind_width + pum_extra_width + 1;
|
||||||
if (pum_width < pum_get_width())
|
if (pum_width < p_pw)
|
||||||
pum_width = pum_get_width();
|
pum_width = p_pw;
|
||||||
}
|
}
|
||||||
else if (((col > pum_get_width() || col > max_width)
|
else if (((col > p_pw || col > max_width)
|
||||||
#ifdef FEAT_RIGHTLEFT
|
#ifdef FEAT_RIGHTLEFT
|
||||||
&& !curwin->w_p_rl)
|
&& !curwin->w_p_rl)
|
||||||
|| (curwin->w_p_rl && (col < Columns - pum_get_width()
|
|| (curwin->w_p_rl && (col < Columns - p_pw
|
||||||
|| col < Columns - max_width)
|
|| col < Columns - max_width)
|
||||||
#endif
|
#endif
|
||||||
))
|
))
|
||||||
@ -282,9 +273,9 @@ pum_display(
|
|||||||
#endif
|
#endif
|
||||||
pum_width = pum_col - pum_scrollbar;
|
pum_width = pum_col - pum_scrollbar;
|
||||||
|
|
||||||
if (pum_width < pum_get_width())
|
if (pum_width < p_pw)
|
||||||
{
|
{
|
||||||
pum_width = pum_get_width();
|
pum_width = p_pw;
|
||||||
#ifdef FEAT_RIGHTLEFT
|
#ifdef FEAT_RIGHTLEFT
|
||||||
if (curwin->w_p_rl)
|
if (curwin->w_p_rl)
|
||||||
{
|
{
|
||||||
@ -300,12 +291,12 @@ pum_display(
|
|||||||
}
|
}
|
||||||
else if (pum_width > max_width + pum_kind_width
|
else if (pum_width > max_width + pum_kind_width
|
||||||
+ pum_extra_width + 1
|
+ pum_extra_width + 1
|
||||||
&& pum_width > pum_get_width())
|
&& pum_width > p_pw)
|
||||||
{
|
{
|
||||||
pum_width = max_width + pum_kind_width
|
pum_width = max_width + pum_kind_width
|
||||||
+ pum_extra_width + 1;
|
+ pum_extra_width + 1;
|
||||||
if (pum_width < pum_get_width())
|
if (pum_width < p_pw)
|
||||||
pum_width = pum_get_width();
|
pum_width = p_pw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,8 +314,8 @@ pum_display(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (max_width > pum_get_width())
|
if (max_width > p_pw)
|
||||||
max_width = pum_get_width(); /* truncate */
|
max_width = p_pw; /* truncate */
|
||||||
#ifdef FEAT_RIGHTLEFT
|
#ifdef FEAT_RIGHTLEFT
|
||||||
if (curwin->w_p_rl)
|
if (curwin->w_p_rl)
|
||||||
pum_col = max_width - 1;
|
pum_col = max_width - 1;
|
||||||
|
|||||||
@ -771,6 +771,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 */
|
||||||
|
/**/
|
||||||
|
1495,
|
||||||
/**/
|
/**/
|
||||||
1494,
|
1494,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user