From: Bram Moolenaar Date: Thu, 15 Aug 2019 19:34:34 +0000 (+0200) Subject: patch 8.1.1850: focus may remain in popup window X-Git-Tag: v8.1.1850 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5dd143e22333a1c320fcf330f6c5061269bd1a17;p=vim patch 8.1.1850: focus may remain in popup window Problem: Focus may remain in popup window. Solution: Change focus if needed. --- diff --git a/src/popupmnu.c b/src/popupmnu.c index 9569ffdfc..2da720a40 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -814,7 +814,7 @@ pum_set_selected(int n, int repeat) * update the view on the buffer. Only go back to * the window when needed, otherwise it will always be * redraw. */ - if (resized) + if (resized && win_valid(curwin_save)) { ++no_u_sync; win_enter(curwin_save, TRUE); @@ -844,6 +844,11 @@ pum_set_selected(int n, int repeat) } } } +# ifdef FEAT_TEXT_PROP + if (WIN_IS_POPUP(curwin)) + // can't keep focus in a popup window + win_enter(firstwin, TRUE); +# endif } #endif } diff --git a/src/version.c b/src/version.c index 4a993dace..64a43beb6 100644 --- a/src/version.c +++ b/src/version.c @@ -769,6 +769,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1850, /**/ 1849, /**/