1
0
forked from aniani/vim

updated for version 7.1-149

This commit is contained in:
Bram Moolenaar
2007-11-06 21:27:31 +00:00
parent e74455a447
commit 9b25ffbb2b
3 changed files with 50 additions and 11 deletions

View File

@@ -3385,8 +3385,8 @@ ins_compl_prep(c)
if (c != Ctrl_R && vim_is_ctrl_x_key(c)) if (c != Ctrl_R && vim_is_ctrl_x_key(c))
edit_submode_extra = NULL; edit_submode_extra = NULL;
/* Ignore end of Select mode mapping */ /* Ignore end of Select mode mapping and mouse scroll buttons. */
if (c == K_SELECT) if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP)
return retval; return retval;
/* Set "compl_get_longest" when finding the first matches. */ /* Set "compl_get_longest" when finding the first matches. */
@@ -8652,15 +8652,16 @@ ins_mousescroll(up)
int up; int up;
{ {
pos_T tpos; pos_T tpos;
# if defined(FEAT_GUI) && defined(FEAT_WINDOWS) # if defined(FEAT_WINDOWS)
win_T *old_curwin; win_T *old_curwin = curwin;
# endif
# ifdef FEAT_INS_EXPAND
int did_scroll = FALSE;
# endif # endif
tpos = curwin->w_cursor; tpos = curwin->w_cursor;
# if defined(FEAT_GUI) && defined(FEAT_WINDOWS) # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
old_curwin = curwin;
/* Currently the mouse coordinates are only known in the GUI. */ /* Currently the mouse coordinates are only known in the GUI. */
if (gui.in_use && mouse_row >= 0 && mouse_col >= 0) if (gui.in_use && mouse_row >= 0 && mouse_col >= 0)
{ {
@@ -8677,10 +8678,23 @@ ins_mousescroll(up)
# endif # endif
undisplay_dollar(); undisplay_dollar();
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)) # ifdef FEAT_INS_EXPAND
scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline)); /* Don't scroll the window in which completion is being done. */
else if (!pum_visible()
scroll_redraw(up, 3L); # if defined(FEAT_WINDOWS)
|| curwin != old_curwin
# endif
)
# endif
{
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline));
else
scroll_redraw(up, 3L);
# ifdef FEAT_INS_EXPAND
did_scroll = TRUE;
# endif
}
# if defined(FEAT_GUI) && defined(FEAT_WINDOWS) # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
curwin->w_redr_status = TRUE; curwin->w_redr_status = TRUE;
@@ -8689,6 +8703,17 @@ ins_mousescroll(up)
curbuf = curwin->w_buffer; curbuf = curwin->w_buffer;
# endif # endif
# ifdef FEAT_INS_EXPAND
/* The popup menu may overlay the window, need to redraw it.
* TODO: Would be more efficient to only redraw the windows that are
* overlapped by the popup menu. */
if (pum_visible() && did_scroll)
{
redraw_all_later(NOT_VALID);
ins_compl_show_pum();
}
# endif
if (!equalpos(curwin->w_cursor, tpos)) if (!equalpos(curwin->w_cursor, tpos))
{ {
start_arrow(&tpos); start_arrow(&tpos);

View File

@@ -4214,7 +4214,19 @@ gui_do_scroll()
#endif #endif
) )
{ {
redraw_win_later(wp, VALID); int type = VALID;
#ifdef FEAT_INS_EXPAND
if (pum_visible())
{
type = NOT_VALID;
wp->w_lines_valid = 0;
}
#endif
/* Don't set must_redraw here, it may cause the popup menu to
* disappear when losing focus after a scrollbar drag. */
if (wp->w_redr_type < type)
wp->w_redr_type = type;
updateWindow(wp); /* update window, status line, and cmdline */ updateWindow(wp); /* update window, status line, and cmdline */
} }

View File

@@ -666,6 +666,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
149,
/**/ /**/
148, 148,
/**/ /**/