diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-02-05 10:29:44 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-02-05 10:29:44 +0000 |
commit | f55493a26fd9dcc42751e57ecacda0f2dc35bd79 (patch) | |
tree | 6c923cf0baeb9e58228f88ce491cb5df6e862075 /usr.bin/tmux/cmd-new-window.c | |
parent | a260dfa82e0bf8576b9a0c10e17ea4eb5a87b620 (diff) |
Wrap all the individual format_* calls in a single format_defaults
functions.
Diffstat (limited to 'usr.bin/tmux/cmd-new-window.c')
-rw-r--r-- | usr.bin/tmux/cmd-new-window.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/usr.bin/tmux/cmd-new-window.c b/usr.bin/tmux/cmd-new-window.c index c0cbea5a2a6..f01ec26b1ce 100644 --- a/usr.bin/tmux/cmd-new-window.c +++ b/usr.bin/tmux/cmd-new-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-window.c,v 1.43 2014/10/20 23:35:28 nicm Exp $ */ +/* $OpenBSD: cmd-new-window.c,v 1.44 2015/02/05 10:29:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -109,11 +109,8 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq) if (args_has(args, 'c')) { ft = format_create(); - if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL) - format_client(ft, c); - format_session(ft, s); - format_winlink(ft, s, s->curw); - format_window_pane(ft, s->curw->window->active); + format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, NULL, + NULL); cp = format_expand(ft, args_get(args, 'c')); format_free(ft); @@ -173,11 +170,8 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq) template = NEW_WINDOW_TEMPLATE; ft = format_create(); - if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL) - format_client(ft, c); - format_session(ft, s); - format_winlink(ft, s, wl); - format_window_pane(ft, wl->window->active); + format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, wl, + NULL); cp = format_expand(ft, template); cmdq_print(cmdq, "%s", cp); |