diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-05 21:52:04 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-05 21:52:04 +0200 |
commit | 1b6d9c4215a56f3dda4df6e05d655c853551ffbd (patch) | |
tree | 57904cb4d8c5ac3513f1f7c946f8dafe949c8498 /src/ex_docmd.c | |
parent | b4a88a0441a65a0c9411c294825a08ca703f541e (diff) |
patch 8.1.1819: :pedit does not work with a popup preview windowv8.1.1819
Problem: :pedit does not work with a popup preview window.
Solution: Avoid aborting with an error. (fixes #4777) Also double check
that after prepare_tagpreview() the current window is not a
popup window.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 3cd615a1fe..74adb847b7 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -7083,7 +7083,7 @@ do_exedit( int need_hide; int exmode_was = exmode_active; - if (ERROR_IF_POPUP_WINDOW) + if (eap->cmdidx != CMD_pedit && ERROR_IF_POPUP_WINDOW) return; /* * ":vi" command ends Ex mode. @@ -8798,9 +8798,11 @@ ex_pedit(exarg_T *eap) g_do_tagpreview = p_pvh; prepare_tagpreview(TRUE); + keep_help_flag = bt_help(curwin_save->w_buffer); do_exedit(eap, NULL); keep_help_flag = FALSE; + if (curwin != curwin_save && win_valid(curwin_save)) { /* Return cursor to where we were */ @@ -8808,6 +8810,13 @@ ex_pedit(exarg_T *eap) redraw_later(VALID); win_enter(curwin_save, TRUE); } +# ifdef FEAT_TEXT_PROP + else if (WIN_IS_POPUP(curwin)) + { + // can't keep focus in popup window + win_enter(firstwin, TRUE); + } +# endif g_do_tagpreview = 0; } #endif |