diff src/edit.c @ 17775:b423bd231f33 v8.1.1884

patch 8.1.1884: cannot use mouse scroll wheel in popup in Insert mode commit https://github.com/vim/vim/commit/f0bc15c769b60f472d411b3ef98d57db510113c1 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 18 19:23:45 2019 +0200 patch 8.1.1884: cannot use mouse scroll wheel in popup in Insert mode Problem: Cannot use mouse scroll wheel in popup in Insert mode. Mouse clicks in popup close the popup menu. Solution: Check if the mouse is in a popup window. Do not let mouse events close the popup menu. (closes #4544)
author Bram Moolenaar <Bram@vim.org>
date Sun, 18 Aug 2019 19:30:03 +0200
parents 5ed4965ebc7b
children 59f8948b7590
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -5267,7 +5267,7 @@ ins_mousescroll(int dir)
 	col = mouse_col;
 
 	/* find the window at the pointer coordinates */
-	wp = mouse_find_win(&row, &col, FAIL_POPUP);
+	wp = mouse_find_win(&row, &col, FIND_POPUP);
 	if (wp == NULL)
 	    return;
 	curwin = wp;
@@ -5288,6 +5288,10 @@ ins_mousescroll(int dir)
 			(long)(curwin->w_botline - curwin->w_topline));
 	    else
 		scroll_redraw(dir, 3L);
+# ifdef FEAT_TEXT_PROP
+	if (WIN_IS_POPUP(curwin))
+	    popup_set_firstline(curwin);
+# endif
 	}
 #ifdef FEAT_GUI
 	else