0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.1.1880: cannot show extra info for completion in a popup window

Problem:    Cannot show extra info for completion in a popup window.
Solution:   Add the "popup" entry in 'completeopt'.
This commit is contained in:
Bram Moolenaar
2019-08-18 15:25:17 +02:00
parent 93cf85f9ef
commit 576a4a6ff1
17 changed files with 310 additions and 56 deletions

View File

@@ -5131,7 +5131,9 @@ free_old_sub(void)
*/
int
prepare_tagpreview(
int undo_sync) /* sync undo when leaving the window */
int undo_sync, // sync undo when leaving the window
int use_previewpopup, // use popup if 'previewpopup' set
int use_popup) // use other popup window
{
win_T *wp;
@@ -5145,11 +5147,16 @@ prepare_tagpreview(
if (!curwin->w_p_pvw)
{
# ifdef FEAT_TEXT_PROP
if (*p_pvp != NUL)
if (use_previewpopup && *p_pvp != NUL)
{
wp = popup_find_preview_window();
if (wp != NULL)
popup_set_wantpos(wp, wp->w_minwidth);
popup_set_wantpos_cursor(wp, wp->w_minwidth);
}
else if (use_popup)
{
wp = popup_find_info_window();
// TODO: set position
}
else
# endif
@@ -5166,8 +5173,8 @@ prepare_tagpreview(
* There is no preview window open yet. Create one.
*/
# ifdef FEAT_TEXT_PROP
if (*p_pvp != NUL)
return popup_create_preview_window();
if ((use_previewpopup && *p_pvp != NUL) || use_popup)
return popup_create_preview_window(use_popup);
# endif
if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0) == FAIL)
return FALSE;