summaryrefslogtreecommitdiffstats
path: root/cmd-split-window.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-03-08 14:01:23 +0000
committerThomas Adam <thomas@xteddy.org>2017-03-08 14:01:23 +0000
commit3ea36830f38eed2d6dad6cb057b3efe772237d5e (patch)
treedad4d842a60527c85e904f63c3e29c596629f4d4 /cmd-split-window.c
parent5d3296c53b820664d50d96b2b926f2c2c1105e97 (diff)
parent6b2009ad725b662853b8e94aee233fabdc5490f9 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-split-window.c')
-rw-r--r--cmd-split-window.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/cmd-split-window.c b/cmd-split-window.c
index 57d58056..cbd5e0b2 100644
--- a/cmd-split-window.c
+++ b/cmd-split-window.c
@@ -53,6 +53,7 @@ static enum cmd_retval
cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = self->args;
+ struct client *c = item->state.c;
struct session *s = item->state.tflag.s;
struct winlink *wl = item->state.tflag.wl;
struct window *w = wl->window;
@@ -64,7 +65,6 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
int argc, size, percentage;
enum layout_type type;
struct layout_cell *lc;
- struct format_tree *ft;
struct environ_entry *envent;
struct cmd_find_state fs;
@@ -91,10 +91,8 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
to_free = NULL;
if (args_has(args, 'c')) {
- ft = format_create(item, FORMAT_NONE, 0);
- format_defaults(ft, item->state.c, s, NULL, NULL);
- to_free = cwd = format_expand(ft, args_get(args, 'c'));
- format_free(ft);
+ cwd = args_get(args, 'c');
+ to_free = cwd = format_single(item, cwd, c, s, NULL, NULL);
} else if (item->client != NULL && item->client->session == NULL)
cwd = item->client->cwd;
else
@@ -167,15 +165,9 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'P')) {
if ((template = args_get(args, 'F')) == NULL)
template = SPLIT_WINDOW_TEMPLATE;
-
- ft = format_create(item, FORMAT_NONE, 0);
- format_defaults(ft, item->state.c, s, wl, new_wp);
-
- cp = format_expand(ft, template);
+ cp = format_single(item, template, c, s, wl, new_wp);
cmdq_print(item, "%s", cp);
free(cp);
-
- format_free(ft);
}
notify_window("window-layout-changed", w);