summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/input-keys.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-04-01 20:56:48 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-04-01 20:56:48 +0000
commite14491529a1d899e31a4ef647197584fa9f2b8e3 (patch)
tree45b928dde2ef8416e76185fa0c94b8718e5d3480 /usr.bin/tmux/input-keys.c
parent7b7c9157e56baf3d29177a21bec70de714fa4465 (diff)
Simplify mouse input function.
Diffstat (limited to 'usr.bin/tmux/input-keys.c')
-rw-r--r--usr.bin/tmux/input-keys.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c
index 157ce5a3a07..beb819b96f6 100644
--- a/usr.bin/tmux/input-keys.c
+++ b/usr.bin/tmux/input-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input-keys.c,v 1.23 2011/07/30 18:01:26 nicm Exp $ */
+/* $OpenBSD: input-keys.c,v 1.24 2012/04/01 20:56:47 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -204,7 +204,6 @@ input_mouse(struct window_pane *wp, struct mouse_event *m)
{
char buf[10];
size_t len;
- int value;
if (wp->screen->mode & ALL_MOUSE_MODES) {
if (wp->screen->mode & MODE_MOUSE_UTF8) {
@@ -221,13 +220,15 @@ input_mouse(struct window_pane *wp, struct mouse_event *m)
buf[len++] = m->y + 33;
}
bufferevent_write(wp->event, buf, len);
- } else if ((m->b & MOUSE_BUTTON) != MOUSE_2) {
- value = options_get_number(&wp->window->options, "mode-mouse");
- if (value == 1 &&
- window_pane_set_mode(wp, &window_copy_mode) == 0) {
+ return;
+ }
+
+ if (options_get_number(&wp->window->options, "mode-mouse") == 1) {
+ if (window_pane_set_mode(wp, &window_copy_mode) == 0) {
window_copy_init_from_pane(wp);
if (wp->mode->mouse != NULL)
wp->mode->mouse(wp, NULL, m);
}
+ return;
}
}