]> granicus.if.org Git - vim/commitdiff
patch 8.1.1850: focus may remain in popup window v8.1.1850
authorBram Moolenaar <Bram@vim.org>
Thu, 15 Aug 2019 19:34:34 +0000 (21:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 15 Aug 2019 19:34:34 +0000 (21:34 +0200)
Problem:    Focus may remain in popup window.
Solution:   Change focus if needed.

src/popupmnu.c
src/version.c

index 9569ffdfc41eb0003c4c462b75a717dcc373bc6e..2da720a40a77ea51c3d9b86284cdb0a1a376ef53 100644 (file)
@@ -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
     }
index 4a993dace155551d171efd6806d826088ee854e6..64a43beb6e17972f44742fb3a5d242bd4100d30d 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1850,
 /**/
     1849,
 /**/