astepano / rpms / vim

Forked from rpms/vim 6 years ago
Clone
d0889bf
To: vim-dev@vim.org
d0889bf
Subject: Patch 7.1.149
d0889bf
Fcc: outbox
d0889bf
From: Bram Moolenaar <Bram@moolenaar.net>
d0889bf
Mime-Version: 1.0
d0889bf
Content-Type: text/plain; charset=ISO-8859-1
d0889bf
Content-Transfer-Encoding: 8bit
d0889bf
------------
d0889bf
d0889bf
Patch 7.1.149
d0889bf
Problem:    GTK GUI: When the completion popup menu is used scrolling another
d0889bf
	    window by the scrollbar is OK, but using the scroll wheel it
d0889bf
	    behaves line <Enter>.
d0889bf
Solution:   Ignore K_MOUSEDOWN and K_MOUSEUP.  Fix redrawing the popup menu.
d0889bf
Files:	    src/edit.c, src/gui.c
d0889bf
d0889bf
d0889bf
*** ../vim-7.1.148/src/edit.c	Fri Oct 19 20:39:56 2007
d0889bf
--- src/edit.c	Sun Nov  4 16:17:42 2007
d0889bf
***************
d0889bf
*** 3385,3392 ****
d0889bf
      if (c != Ctrl_R && vim_is_ctrl_x_key(c))
d0889bf
  	edit_submode_extra = NULL;
d0889bf
  
d0889bf
!     /* Ignore end of Select mode mapping */
d0889bf
!     if (c == K_SELECT)
d0889bf
  	return retval;
d0889bf
  
d0889bf
      /* Set "compl_get_longest" when finding the first matches. */
d0889bf
--- 3385,3392 ----
d0889bf
      if (c != Ctrl_R && vim_is_ctrl_x_key(c))
d0889bf
  	edit_submode_extra = NULL;
d0889bf
  
d0889bf
!     /* Ignore end of Select mode mapping and mouse scroll buttons. */
d0889bf
!     if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP)
d0889bf
  	return retval;
d0889bf
  
d0889bf
      /* Set "compl_get_longest" when finding the first matches. */
d0889bf
***************
d0889bf
*** 8652,8666 ****
d0889bf
      int		up;
d0889bf
  {
d0889bf
      pos_T	tpos;
d0889bf
! # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
d0889bf
!     win_T	*old_curwin;
d0889bf
  # endif
d0889bf
  
d0889bf
      tpos = curwin->w_cursor;
d0889bf
  
d0889bf
  # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
d0889bf
-     old_curwin = curwin;
d0889bf
- 
d0889bf
      /* Currently the mouse coordinates are only known in the GUI. */
d0889bf
      if (gui.in_use && mouse_row >= 0 && mouse_col >= 0)
d0889bf
      {
d0889bf
--- 8652,8667 ----
d0889bf
      int		up;
d0889bf
  {
d0889bf
      pos_T	tpos;
d0889bf
! # if defined(FEAT_WINDOWS)
d0889bf
!     win_T	*old_curwin = curwin;
d0889bf
! # endif
d0889bf
! # ifdef FEAT_INS_EXPAND
d0889bf
!     int		did_scroll = FALSE;
d0889bf
  # endif
d0889bf
  
d0889bf
      tpos = curwin->w_cursor;
d0889bf
  
d0889bf
  # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
d0889bf
      /* Currently the mouse coordinates are only known in the GUI. */
d0889bf
      if (gui.in_use && mouse_row >= 0 && mouse_col >= 0)
d0889bf
      {
d0889bf
***************
d0889bf
*** 8677,8692 ****
d0889bf
  # endif
d0889bf
  	undisplay_dollar();
d0889bf
  
d0889bf
!     if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
d0889bf
! 	scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline));
d0889bf
!     else
d0889bf
! 	scroll_redraw(up, 3L);
d0889bf
  
d0889bf
  # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
d0889bf
      curwin->w_redr_status = TRUE;
d0889bf
  
d0889bf
      curwin = old_curwin;
d0889bf
      curbuf = curwin->w_buffer;
d0889bf
  # endif
d0889bf
  
d0889bf
      if (!equalpos(curwin->w_cursor, tpos))
d0889bf
--- 8678,8717 ----
d0889bf
  # endif
d0889bf
  	undisplay_dollar();
d0889bf
  
d0889bf
! # ifdef FEAT_INS_EXPAND
d0889bf
!     /* Don't scroll the window in which completion is being done. */
d0889bf
!     if (!pum_visible()
d0889bf
! #  if defined(FEAT_WINDOWS)
d0889bf
! 	    || curwin != old_curwin
d0889bf
! #  endif
d0889bf
! 	    )
d0889bf
! # endif
d0889bf
!     {
d0889bf
! 	if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
d0889bf
! 	    scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline));
d0889bf
! 	else
d0889bf
! 	    scroll_redraw(up, 3L);
d0889bf
! # ifdef FEAT_INS_EXPAND
d0889bf
! 	did_scroll = TRUE;
d0889bf
! # endif
d0889bf
!     }
d0889bf
  
d0889bf
  # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
d0889bf
      curwin->w_redr_status = TRUE;
d0889bf
  
d0889bf
      curwin = old_curwin;
d0889bf
      curbuf = curwin->w_buffer;
d0889bf
+ # endif
d0889bf
+ 
d0889bf
+ # ifdef FEAT_INS_EXPAND
d0889bf
+     /* The popup menu may overlay the window, need to redraw it.
d0889bf
+      * TODO: Would be more efficient to only redraw the windows that are
d0889bf
+      * overlapped by the popup menu. */
d0889bf
+     if (pum_visible() && did_scroll)
d0889bf
+     {
d0889bf
+ 	redraw_all_later(NOT_VALID);
d0889bf
+ 	ins_compl_show_pum();
d0889bf
+     }
d0889bf
  # endif
d0889bf
  
d0889bf
      if (!equalpos(curwin->w_cursor, tpos))
d0889bf
*** ../vim-7.1.148/src/gui.c	Wed Sep  5 21:45:54 2007
d0889bf
--- src/gui.c	Fri Oct 19 16:14:57 2007
d0889bf
***************
d0889bf
*** 4214,4220 ****
d0889bf
  #endif
d0889bf
  	    )
d0889bf
      {
d0889bf
! 	redraw_win_later(wp, VALID);
d0889bf
  	updateWindow(wp);   /* update window, status line, and cmdline */
d0889bf
      }
d0889bf
  
d0889bf
--- 4214,4232 ----
d0889bf
  #endif
d0889bf
  	    )
d0889bf
      {
d0889bf
! 	int type = VALID;
d0889bf
! 
d0889bf
! #ifdef FEAT_INS_EXPAND
d0889bf
! 	if (pum_visible())
d0889bf
! 	{
d0889bf
! 	    type = NOT_VALID;
d0889bf
! 	    wp->w_lines_valid = 0;
d0889bf
! 	}
d0889bf
! #endif
d0889bf
! 	/* Don't set must_redraw here, it may cause the popup menu to
d0889bf
! 	 * disappear when losing focus after a scrollbar drag. */
d0889bf
! 	if (wp->w_redr_type < type)
d0889bf
! 	    wp->w_redr_type = type;
d0889bf
  	updateWindow(wp);   /* update window, status line, and cmdline */
d0889bf
      }
d0889bf
  
d0889bf
*** ../vim-7.1.148/src/version.c	Sun Nov  4 15:35:23 2007
d0889bf
--- src/version.c	Tue Nov  6 22:21:03 2007
d0889bf
***************
d0889bf
*** 668,669 ****
d0889bf
--- 668,671 ----
d0889bf
  {   /* Add new patch number below this line */
d0889bf
+ /**/
d0889bf
+     149,
d0889bf
  /**/
d0889bf
d0889bf
-- 
d0889bf
From "know your smileys":
d0889bf
 ...---...   SOS
d0889bf
d0889bf
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
d0889bf
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
d0889bf
\\\        download, build and distribute -- http://www.A-A-P.org        ///
d0889bf
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///