diff src/popupmnu.c @ 17706:431d52b7f7d3 v8.1.1850

patch 8.1.1850: focus may remain in popup window commit https://github.com/vim/vim/commit/5dd143e22333a1c320fcf330f6c5061269bd1a17 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 15 21:34:34 2019 +0200 patch 8.1.1850: focus may remain in popup window Problem: Focus may remain in popup window. Solution: Change focus if needed.
author Bram Moolenaar <Bram@vim.org>
date Thu, 15 Aug 2019 21:45:04 +0200
parents 8a095d343c59
children c75da1064e33
line wrap: on
line diff
--- 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
     }