summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-copy-mode.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-04-21 15:34:33 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-04-21 15:34:33 +0000
commit6196b6614aaaec8d4dcac0ae686aec6ec7999561 (patch)
tree95e223e426477a861240e5daca8f397edb3b78fa /usr.bin/tmux/cmd-copy-mode.c
parent0a096310c94a0cfb92cd7696b9ab2d0677eaf0d9 (diff)
Bind mouse dragging so that it is passed through to applications if they
want it rather than entering copy mode.
Diffstat (limited to 'usr.bin/tmux/cmd-copy-mode.c')
-rw-r--r--usr.bin/tmux/cmd-copy-mode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-copy-mode.c b/usr.bin/tmux/cmd-copy-mode.c
index 0fa1f655558..0916be98aeb 100644
--- a/usr.bin/tmux/cmd-copy-mode.c
+++ b/usr.bin/tmux/cmd-copy-mode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-copy-mode.c,v 1.19 2015/04/19 21:34:21 nicm Exp $ */
+/* $OpenBSD: cmd-copy-mode.c,v 1.20 2015/04/21 15:34:32 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -68,8 +68,11 @@ cmd_copy_mode_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_NORMAL);
window_copy_init_from_pane(wp);
}
- if (args_has(args, 'M'))
+ if (args_has(args, 'M')) {
+ if (wp->mode != NULL && wp->mode != &window_copy_mode)
+ return (CMD_RETURN_NORMAL);
window_copy_start_drag(c, &cmdq->item->mouse);
+ }
if (wp->mode == &window_copy_mode && args_has(self->args, 'u'))
window_copy_pageup(wp);