diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-03-16 14:20:51 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-03-16 14:20:51 +0100 |
commit | 2526ef276b97b1a5275fc0039fb45ca7aa7b6fac (patch) | |
tree | 45c6e395fa38446c3fd7952f0e828ecd9dc5f5b0 /src/normal.c | |
parent | 20754027b3b8c29dfc5ee0b5dfa6a5459ea6b903 (diff) | |
download | vim-git-2526ef276b97b1a5275fc0039fb45ca7aa7b6fac.tar.gz |
updated for version 7.3.862v7.3.862
Problem: Dragging the status line can be slow.
Solution: Look ahead and drop the drag event if there is a next one.
Diffstat (limited to 'src/normal.c')
-rw-r--r-- | src/normal.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c index 3de170d6e..d6c0abb11 100644 --- a/src/normal.c +++ b/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 |