From 4946f74253de52f10beb023d4c5b88bafdb11ec4 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 5 Feb 2015 10:29:43 +0000 Subject: Wrap all the individual format_* calls in a single format_defaults functions. --- cmd-split-window.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'cmd-split-window.c') diff --git a/cmd-split-window.c b/cmd-split-window.c index 7e34e523..d26ce821 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -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); -- cgit From f1e68bfdd22dc1fa13630cb64855506643e01c5c Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 5 Feb 2015 10:32:39 +0000 Subject: Remove a couple of now-unused variables. --- cmd-split-window.c | 1 - 1 file changed, 1 deletion(-) (limited to 'cmd-split-window.c') diff --git a/cmd-split-window.c b/cmd-split-window.c index d26ce821..680b1560 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -59,7 +59,6 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq) int argc, size, percentage, cwd, fd = -1; enum layout_type type; struct layout_cell *lc; - struct client *c; struct format_tree *ft; struct environ_entry *envent; -- cgit