1
0
forked from aniani/vim

patch 8.1.1892: missing index entry and option menu for 'completepopup'

Problem:    Missing index entry and option menu for 'completepopup'.
Solution:   Add the entries.  Adjust #ifdefs to avoid dead code.
This commit is contained in:
Bram Moolenaar
2019-08-20 21:12:16 +02:00
parent 5843f5f37b
commit 36e4d985f0
6 changed files with 26 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 8.1. Last change: 2019 Aug 01 *quickref.txt* For Vim version 8.1. Last change: 2019 Aug 20
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -651,6 +651,7 @@ Short explanation of each option: *option-list*
'complete' 'cpt' specify how Insert mode completion works 'complete' 'cpt' specify how Insert mode completion works
'completefunc' 'cfu' function to be used for Insert mode completion 'completefunc' 'cfu' function to be used for Insert mode completion
'completeopt' 'cot' options for Insert mode completion 'completeopt' 'cot' options for Insert mode completion
'completepopup' 'cpp' options for the Insert mode completion info popup
'completeslash' 'csl' like 'shellslash' for completion 'completeslash' 'csl' like 'shellslash' for completion
'concealcursor' 'cocu' whether concealable text is hidden in cursor line 'concealcursor' 'cocu' whether concealable text is hidden in cursor line
'conceallevel' 'cole' whether concealable text is shown or hidden 'conceallevel' 'cole' whether concealable text is shown or hidden

View File

@@ -1,7 +1,7 @@
" These commands create the option window. " These commands create the option window.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Aug 01 " Last Change: 2019 Aug 20
" If there already is an option window, jump to that one. " If there already is an option window, jump to that one.
let buf = bufnr('option-window') let buf = bufnr('option-window')
@@ -806,6 +806,10 @@ if has("insert_expand")
call <SID>OptionL("cpt") call <SID>OptionL("cpt")
call append("$", "completeopt\twhether to use a popup menu for Insert mode completion") call append("$", "completeopt\twhether to use a popup menu for Insert mode completion")
call <SID>OptionG("cot", &cot) call <SID>OptionG("cot", &cot)
if exists("+completepopup")
call append("$", "completepopup\toptions for the Insert mode completion info popup")
call <SID>OptionG("cpp", &cpp)
endif
call append("$", "pumheight\tmaximum height of the popup menu") call append("$", "pumheight\tmaximum height of the popup menu")
call <SID>OptionG("ph", &ph) call <SID>OptionG("ph", &ph)
call append("$", "pumwidth\tminimum width of the popup menu") call append("$", "pumwidth\tminimum width of the popup menu")

View File

@@ -894,7 +894,7 @@ static struct vimoption options[] =
#endif #endif
SCTX_INIT}, SCTX_INIT},
{"completepopup", "cpp", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, {"completepopup", "cpp", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
#ifdef FEAT_TEXT_PROP #if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX)
(char_u *)&p_cpp, PV_NONE, (char_u *)&p_cpp, PV_NONE,
{(char_u *)"", (char_u *)0L} {(char_u *)"", (char_u *)0L}
#else #else
@@ -7830,12 +7830,14 @@ did_set_string_option(
if (parse_previewpopup(NULL) == FAIL) if (parse_previewpopup(NULL) == FAIL)
errmsg = e_invarg; errmsg = e_invarg;
} }
# ifdef FEAT_QUICKFIX
// 'completepopup' // 'completepopup'
else if (varp == &p_cpp) else if (varp == &p_cpp)
{ {
if (parse_completepopup(NULL) == FAIL) if (parse_completepopup(NULL) == FAIL)
errmsg = e_invarg; errmsg = e_invarg;
} }
# endif
#endif #endif
/* Options that are a list of flags. */ /* Options that are a list of flags. */

View File

@@ -503,7 +503,9 @@ 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
# ifdef FEAT_QUICKFIX
EXTERN char_u *p_cpp; // 'completepopup' EXTERN char_u *p_cpp; // 'completepopup'
# endif
EXTERN char_u *p_pvp; // 'previewpopup' EXTERN char_u *p_pvp; // 'previewpopup'
#endif #endif
#ifdef FEAT_PRINTER #ifdef FEAT_PRINTER

View File

@@ -1294,9 +1294,13 @@ popup_set_buffer_text(buf_T *buf, typval_T text)
static int static int
parse_popup_option(win_T *wp, int is_preview) parse_popup_option(win_T *wp, int is_preview)
{ {
char_u *p; char_u *p =
#ifdef FEAT_QUICKFIX
!is_preview ? p_cpp :
#endif
p_pvp;
for (p = is_preview ? p_pvp : p_cpp; *p != NUL; p += (*p == ',' ? 1 : 0)) for ( ; *p != NUL; p += (*p == ',' ? 1 : 0))
{ {
char_u *e, *dig; char_u *e, *dig;
char_u *s = p; char_u *s = p;
@@ -1674,6 +1678,7 @@ popup_create(typval_T *argvars, typval_T *rettv, create_type_T type)
parse_previewpopup(wp); parse_previewpopup(wp);
popup_set_wantpos_cursor(wp, wp->w_minwidth); popup_set_wantpos_cursor(wp, wp->w_minwidth);
} }
# ifdef FEAT_QUICKFIX
if (type == TYPE_INFO) if (type == TYPE_INFO)
{ {
wp->w_popup_pos = POPPOS_TOPLEFT; wp->w_popup_pos = POPPOS_TOPLEFT;
@@ -1682,6 +1687,7 @@ popup_create(typval_T *argvars, typval_T *rettv, create_type_T type)
add_border_left_right_padding(wp); add_border_left_right_padding(wp);
parse_completepopup(wp); parse_completepopup(wp);
} }
# endif
for (i = 0; i < 4; ++i) for (i = 0; i < 4; ++i)
VIM_CLEAR(wp->w_border_highlight[i]); VIM_CLEAR(wp->w_border_highlight[i]);
@@ -3257,6 +3263,7 @@ popup_is_popup(win_T *wp)
return wp->w_popup_flags != 0; return wp->w_popup_flags != 0;
} }
#if defined(FEAT_QUICKFIX) || defined(PROTO)
/* /*
* Find an existing popup used as the info window, in the current tab page. * Find an existing popup used as the info window, in the current tab page.
* Return NULL if not found. * Return NULL if not found.
@@ -3272,6 +3279,7 @@ popup_find_info_window(void)
return wp; return wp;
return NULL; return NULL;
} }
#endif
void void
f_popup_getpreview(typval_T *argvars UNUSED, typval_T *rettv) f_popup_getpreview(typval_T *argvars UNUSED, typval_T *rettv)
@@ -3314,6 +3322,7 @@ popup_create_preview_window(int info)
return OK; return OK;
} }
#if defined(FEAT_QUICKFIX) || defined(PROTO)
void void
popup_close_preview(int info) popup_close_preview(int info)
{ {
@@ -3328,6 +3337,7 @@ popup_close_preview(int info)
popup_close_and_callback(wp, &res); popup_close_and_callback(wp, &res);
} }
} }
#endif
/* /*
* Set the title of the popup window to the file name. * Set the title of the popup window to the file name.

View File

@@ -765,6 +765,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 */
/**/
1892,
/**/ /**/
1891, 1891,
/**/ /**/