summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-18 21:43:07 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-18 21:43:07 +0200
commit7964873afe59d0896a921b7c585167674bb784d5 (patch)
treec72d46d9af739d51471bf940a1bc077e526daaf5 /src/ex_cmds.c
parentdf9c6cad8cc318e26e99c3b055f0788e7d6582de (diff)
patch 8.1.1714: cannot preview a file in a popup windowv8.1.1714
Problem: Cannot preview a file in a popup window. Solution: Add the 'previewpopup' option.
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 4126fe09f9..e262da1d59 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -6270,9 +6270,20 @@ prepare_tagpreview(
*/
if (!curwin->w_p_pvw)
{
- FOR_ALL_WINDOWS(wp)
- if (wp->w_p_pvw)
- break;
+# ifdef FEAT_TEXT_PROP
+ if (*p_pvp != NUL)
+ {
+ wp = popup_find_preview_window();
+ if (wp != NULL)
+ popup_set_wantpos(wp);
+ }
+ else
+# endif
+ {
+ FOR_ALL_WINDOWS(wp)
+ if (wp->w_p_pvw)
+ break;
+ }
if (wp != NULL)
win_enter(wp, undo_sync);
else
@@ -6280,18 +6291,21 @@ prepare_tagpreview(
/*
* There is no preview window open yet. Create one.
*/
- if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0)
- == FAIL)
+# ifdef FEAT_TEXT_PROP
+ if (*p_pvp != NUL)
+ return popup_create_preview_window();
+# endif
+ if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0) == FAIL)
return FALSE;
curwin->w_p_pvw = TRUE;
curwin->w_p_wfh = TRUE;
- RESET_BINDING(curwin); /* don't take over 'scrollbind'
- and 'cursorbind' */
+ RESET_BINDING(curwin); // don't take over 'scrollbind'
+ // and 'cursorbind'
# ifdef FEAT_DIFF
- curwin->w_p_diff = FALSE; /* no 'diff' */
+ curwin->w_p_diff = FALSE; // no 'diff'
# endif
# ifdef FEAT_FOLDING
- curwin->w_p_fdc = 0; /* no 'foldcolumn' */
+ curwin->w_p_fdc = 0; // no 'foldcolumn'
# endif
return TRUE;
}