diff src/evalfunc.c @ 17041:5ed4965ebc7b v8.1.1520

patch 8.1.1520: popup windows are ignored when dealing with mouse position commit https://github.com/vim/vim/commit/451d4b5b7c7262631cd1f5057c75d6f5f5772fb1 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 12 20:22:27 2019 +0200 patch 8.1.1520: popup windows are ignored when dealing with mouse position Problem: Popup windows are ignored when dealing with mouse position Solution: Find the mouse position inside a popup window. Allow for modeless selection.
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Jun 2019 20:30:07 +0200
parents 905e1b154058
children 7fe328ad5573
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5154,12 +5154,18 @@ f_getchar(typval_T *argvars, typval_T *r
 	    {
 		/* Find the window at the mouse coordinates and compute the
 		 * text position. */
-		win = mouse_find_win(&row, &col);
+		win = mouse_find_win(&row, &col, FIND_POPUP);
 		if (win == NULL)
 		    return;
 		(void)mouse_comp_pos(win, &row, &col, &lnum);
-		for (wp = firstwin; wp != win; wp = wp->w_next)
-		    ++winnr;
+# ifdef FEAT_TEXT_PROP
+		if (bt_popup(win->w_buffer))
+		    winnr = 0;
+		else
+# endif
+		    for (wp = firstwin; wp != win && wp != NULL;
+							       wp = wp->w_next)
+			++winnr;
 		set_vim_var_nr(VV_MOUSE_WIN, winnr);
 		set_vim_var_nr(VV_MOUSE_WINID, win->w_id);
 		set_vim_var_nr(VV_MOUSE_LNUM, lnum);