mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Wrap all the individual format_* calls in a single format_defaults
functions.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user