summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-split-window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-02-05 10:29:43 +0000
committernicm <nicm@openbsd.org>2015-02-05 10:29:43 +0000
commitf426771eab9e2362a30890108867d3e8ac72113a (patch)
treea29c739b6286417a527b2a9ab5372ba4fa486e28 /usr.bin/tmux/cmd-split-window.c
parentimplement SIOCIFAFATTACH and SIOCIFAFDETACH for AF_INET (diff)
downloadwireguard-openbsd-f426771eab9e2362a30890108867d3e8ac72113a.tar.xz
wireguard-openbsd-f426771eab9e2362a30890108867d3e8ac72113a.zip
Wrap all the individual format_* calls in a single format_defaults
functions.
Diffstat (limited to 'usr.bin/tmux/cmd-split-window.c')
-rw-r--r--usr.bin/tmux/cmd-split-window.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/usr.bin/tmux/cmd-split-window.c b/usr.bin/tmux/cmd-split-window.c
index e4215941c2d..6cd066ed968 100644
--- a/usr.bin/tmux/cmd-split-window.c
+++ b/usr.bin/tmux/cmd-split-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-split-window.c,v 1.54 2014/11/12 22:57:06 nicm Exp $ */
+/* $OpenBSD: cmd-split-window.c,v 1.55 2015/02/05 10:29:43 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -89,11 +89,8 @@ cmd_split_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);
@@ -181,11 +178,8 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
template = SPLIT_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, new_wp);
+ format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, wl,
+ new_wp);
cp = format_expand(ft, template);
cmdq_print(cmdq, "%s", cp);