Make the mode used to view command output (a variant of copy mode) use

its own mode definition struct with a different init function rather
than calling special setup functions.
This commit is contained in:
nicm
2019-03-08 10:34:20 +00:00
parent 9cc04a0f9a
commit de730f68a4
6 changed files with 66 additions and 51 deletions

View File

@ -75,10 +75,9 @@ cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item)
}
if (wp->mode == NULL || wp->mode->mode != &window_copy_mode) {
flag = window_pane_set_mode(wp, &window_copy_mode, NULL, NULL);
flag = window_pane_set_mode(wp, &window_copy_mode, NULL, args);
if (flag != 0)
return (CMD_RETURN_NORMAL);
window_copy_init_from_pane(wp, args_has(self->args, 'e'));
}
if (args_has(args, 'M')) {
if (wp->mode != NULL && wp->mode->mode != &window_copy_mode)