aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-02-13 12:05:51 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-02-16 23:17:38 -0300
commite17f92eb29de90e793ec14857fc5609f53cc863d (patch)
tree639ab1e57866ef12af0aec48e42b40ce648e9be8
parent2b6ffa61bf0206b0c598b65f5cc7ca8d5740f888 (diff)
downloadrneovim-e17f92eb29de90e793ec14857fc5609f53cc863d.tar.gz
rneovim-e17f92eb29de90e793ec14857fc5609f53cc863d.tar.bz2
rneovim-e17f92eb29de90e793ec14857fc5609f53cc863d.zip
input: Fix handle_mouse_event function
Ignore all keys that aren't prefixed with KS_EXTRA.
-rw-r--r--src/nvim/os/input.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index 4d50f1dc92..d5e29900e9 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -215,15 +215,19 @@ static unsigned int handle_mouse_event(char **ptr, uint8_t *buf,
unsigned int bufsize)
{
int mouse_code = 0;
+ int type = 0;
if (bufsize == 3) {
mouse_code = buf[2];
+ type = buf[1];
} else if (bufsize == 6) {
// prefixed with K_SPECIAL KS_MODIFIER mod
mouse_code = buf[5];
+ type = buf[4];
}
- if (!((mouse_code >= KE_LEFTMOUSE && mouse_code <= KE_RIGHTRELEASE)
+ if (type != KS_EXTRA
+ || !((mouse_code >= KE_LEFTMOUSE && mouse_code <= KE_RIGHTRELEASE)
|| (mouse_code >= KE_MOUSEDOWN && mouse_code <= KE_MOUSERIGHT))) {
return bufsize;
}