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

5
cfg.c
View File

@ -348,7 +348,10 @@ cfg_show_causes(struct session *s)
return;
wp = s->curw->window->active;
window_copy_init_for_output(wp);
if (wp->mode == NULL || wp->mode->mode != &window_view_mode) {
window_pane_reset_mode(wp);
window_pane_set_mode(wp, &window_view_mode, NULL, NULL);
}
for (i = 0; i < cfg_ncauses; i++) {
window_copy_add(wp, "%s", cfg_causes[i]);
free(cfg_causes[i]);