diff options
author | nicm <nicm> | 2019-03-12 11:16:49 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-03-12 11:16:49 +0000 |
commit | 3f6bfbaf2babcc7f08f628a82ff31b0b52014e58 (patch) | |
tree | ce4bf0c954cdfede0c2e86905bd85a9f565ed370 /cmd-copy-mode.c | |
parent | ff4c80d53df96bb46eaa64107673e42d402f0d49 (diff) | |
download | rtmux-3f6bfbaf2babcc7f08f628a82ff31b0b52014e58.tar.gz rtmux-3f6bfbaf2babcc7f08f628a82ff31b0b52014e58.tar.bz2 rtmux-3f6bfbaf2babcc7f08f628a82ff31b0b52014e58.zip |
Allow multiple modes to be open in a pane. A stack of open modes is kept
and the previous restored when the top is exited. If a mode that is
already on the stack is entered, the existing instance is moved to the
top as the active mode rather than being opened new.
Diffstat (limited to 'cmd-copy-mode.c')
-rw-r--r-- | cmd-copy-mode.c | 13 |
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); |