aboutsummaryrefslogtreecommitdiff
path: root/cmd-copy-mode.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-copy-mode.c')
-rw-r--r--cmd-copy-mode.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/cmd-copy-mode.c b/cmd-copy-mode.c
index d9471aab..bd05f8a2 100644
--- a/cmd-copy-mode.c
+++ b/cmd-copy-mode.c
@@ -60,7 +60,6 @@ cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item)
struct client *c = item->client;
struct session *s;
struct window_pane *wp = item->target.wp;
- int flag;
if (args_has(args, 'M')) {
if ((wp = cmd_mouse_pane(&shared->mouse, &s, NULL)) == NULL)
@@ -74,16 +73,10 @@ cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item)
return (CMD_RETURN_NORMAL);
}
- if (wp->mode == NULL || wp->mode->mode != &window_copy_mode) {
- flag = window_pane_set_mode(wp, &window_copy_mode, NULL, args);
- if (flag != 0)
- return (CMD_RETURN_NORMAL);
- }
- if (args_has(args, 'M')) {
- if (wp->mode != NULL && wp->mode->mode != &window_copy_mode)
- return (CMD_RETURN_NORMAL);
+ if (window_pane_set_mode(wp, &window_copy_mode, NULL, args) != 0)
+ return (CMD_RETURN_NORMAL);
+ if (args_has(args, 'M'))
window_copy_start_drag(c, &shared->mouse);
- }
if (args_has(self->args, 'u'))
window_copy_pageup(wp, 0);