diff options
author | nicm <nicm> | 2019-03-08 10:34:20 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-03-08 10:34:20 +0000 |
commit | de730f68a4bc97e26f8f5dcb404ed27dc489c0fd (patch) | |
tree | e55ae16a116c303ea67fa8daf0f85172828c5374 /cmd-queue.c | |
parent | 9cc04a0f9a62c5f4d9e643538f0f866115d6b16d (diff) | |
download | rtmux-de730f68a4bc97e26f8f5dcb404ed27dc489c0fd.tar.gz rtmux-de730f68a4bc97e26f8f5dcb404ed27dc489c0fd.tar.bz2 rtmux-de730f68a4bc97e26f8f5dcb404ed27dc489c0fd.zip |
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.
Diffstat (limited to 'cmd-queue.c')
-rw-r--r-- | cmd-queue.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/cmd-queue.c b/cmd-queue.c index ccb25c9a..2a95a3e5 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -404,10 +404,10 @@ cmdq_guard(struct cmdq_item *item, const char *guard, int flags) void cmdq_print(struct cmdq_item *item, const char *fmt, ...) { - struct client *c = item->client; - struct window *w; - va_list ap; - char *tmp, *msg; + struct client *c = item->client; + struct window_pane *wp; + va_list ap; + char *tmp, *msg; va_start(ap, fmt); @@ -425,9 +425,12 @@ cmdq_print(struct cmdq_item *item, const char *fmt, ...) evbuffer_add(c->stdout_data, "\n", 1); server_client_push_stdout(c); } else { - w = c->session->curw->window; - window_copy_init_for_output(w->active); - window_copy_vadd(w->active, fmt, ap); + wp = c->session->curw->window->active; + 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); + } + window_copy_vadd(wp, fmt, ap); } va_end(ap); |