comparison src/popupmnu.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 c75da1064e33
children 87c5c07a4cac
comparison
equal deleted inserted replaced
17774:fa8b9059947b 17775:b423bd231f33
636 static int 636 static int
637 pum_set_selected(int n, int repeat) 637 pum_set_selected(int n, int repeat)
638 { 638 {
639 int resized = FALSE; 639 int resized = FALSE;
640 int context = pum_height / 2; 640 int context = pum_height / 2;
641 int prev_selected = pum_selected;
641 #ifdef FEAT_TEXT_PROP 642 #ifdef FEAT_TEXT_PROP
642 int has_info = FALSE; 643 int has_info = FALSE;
643 #endif 644 #endif
644 645
645 pum_selected = n; 646 pum_selected = n;
824 } 825 }
825 } 826 }
826 827
827 curbuf->b_changed = 0; 828 curbuf->b_changed = 0;
828 curbuf->b_p_ma = FALSE; 829 curbuf->b_p_ma = FALSE;
829 curwin->w_cursor.lnum = 1; 830 if (pum_selected != prev_selected)
831 {
832 # ifdef FEAT_TEXT_PROP
833 curwin->w_firstline = 1;
834 # endif
835 curwin->w_topline = 1;
836 }
837 else if (curwin->w_topline > curbuf->b_ml.ml_line_count)
838 curwin->w_topline = curbuf->b_ml.ml_line_count;
839 curwin->w_cursor.lnum = curwin->w_topline;
830 curwin->w_cursor.col = 0; 840 curwin->w_cursor.col = 0;
831 if (use_popup && win_valid(curwin_save)) 841 if (use_popup && win_valid(curwin_save))
832 redraw_win_later(curwin_save, SOME_VALID); 842 redraw_win_later(curwin_save, SOME_VALID);
833 843
834 if ((curwin != curwin_save && win_valid(curwin_save)) 844 if ((curwin != curwin_save && win_valid(curwin_save))