mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
updated for version 7.3.862
Problem: Dragging the status line can be slow. Solution: Look ahead and drop the drag event if there is a next one.
This commit is contained in:
26
src/normal.c
26
src/normal.c
@@ -2443,7 +2443,31 @@ do_mouse(oap, c, dir, count, fixindent)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
which_button = get_mouse_button(KEY2TERMCAP1(c), &is_click, &is_drag);
|
||||
for (;;)
|
||||
{
|
||||
which_button = get_mouse_button(KEY2TERMCAP1(c), &is_click, &is_drag);
|
||||
if (is_drag)
|
||||
{
|
||||
/* If the next character is the same mouse event then use that
|
||||
* one. Speeds up dragging the status line. */
|
||||
if (vpeekc() != NUL)
|
||||
{
|
||||
int nc;
|
||||
int save_mouse_row = mouse_row;
|
||||
int save_mouse_col = mouse_col;
|
||||
|
||||
/* Need to get the character, peeking doesn't get the actual
|
||||
* one. */
|
||||
nc = safe_vgetc();
|
||||
if (c == nc)
|
||||
continue;
|
||||
vungetc(nc);
|
||||
mouse_row = save_mouse_row;
|
||||
mouse_col = save_mouse_col;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef FEAT_MOUSESHAPE
|
||||
/* May have stopped dragging the status or separator line. The pointer is
|
||||
|
Reference in New Issue
Block a user