Handle failure to change mode, to avoid dying when switching into copy

mode when already in a different mode. Reported by "Florian".
pull/1/head
Nicholas Marriott 2010-08-11 07:41:05 +00:00
parent 3999886901
commit ae70071494
1 changed files with 2 additions and 1 deletions

View File

@ -62,7 +62,8 @@ cmd_copy_mode_exec(struct cmd *self, struct cmd_ctx *ctx)
if (cmd_find_pane(ctx, data->target, NULL, &wp) == NULL)
return (-1);
window_pane_set_mode(wp, &window_copy_mode);
if (window_pane_set_mode(wp, &window_copy_mode) != 0)
return (0);
window_copy_init_from_pane(wp);
if (wp->mode == &window_copy_mode && cmd_check_flag(data->chflags, 'u'))
window_copy_pageup(wp);