diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-08-21 21:03:37 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-08-21 21:03:37 +0200 |
commit | de7762a2c1498e2dc43586feb5f982d661799f85 (patch) | |
tree | d6b6fb5079450e55334c52e37a11ad754c720442 /src/term.c | |
parent | 9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c (diff) | |
download | vim-git-de7762a2c1498e2dc43586feb5f982d661799f85.tar.gz |
patch 7.4.2238v7.4.2238
Problem: With SGR mouse reporting (suckless terminal) the mouse release and
scroll up/down is confused.
Solution: Don't see a release as a scroll up/down. (Ralph Eastwood)
Diffstat (limited to 'src/term.c')
-rw-r--r-- | src/term.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/term.c b/src/term.c index 774ef6552..4d505e33d 100644 --- a/src/term.c +++ b/src/term.c @@ -4939,7 +4939,7 @@ check_termcode( button = getdigits(&p); mouse_code = 0; - switch( button ) + switch (button) { case 4: mouse_code = MOUSE_LEFT; break; case 1: mouse_code = MOUSE_RIGHT; break; @@ -4947,7 +4947,7 @@ check_termcode( default: return -1; } - switch( action ) + switch (action) { case 31: /* Initial press */ if (*p++ != ';') @@ -5096,9 +5096,11 @@ check_termcode( else if (orig_num_clicks == 4) modifiers |= MOD_MASK_4CLICK; - /* Work out our pseudo mouse event */ + /* Work out our pseudo mouse event. Note that MOUSE_RELEASE gets + * added, then it's not mouse up/down. */ key_name[0] = (int)KS_EXTRA; - if (wheel_code != 0) + if (wheel_code != 0 + && (wheel_code & MOUSE_RELEASE) != MOUSE_RELEASE) { if (wheel_code & MOUSE_CTRL) modifiers |= MOD_MASK_CTRL; |