diff options
author | nicm <nicm> | 2021-08-20 19:50:16 +0000 |
---|---|---|
committer | nicm <nicm> | 2021-08-20 19:50:16 +0000 |
commit | 5f32b7d9613e9ef3f8198302379a42630323da6a (patch) | |
tree | 0a0b488496625e9da5cbc02c5a1271634568ecc3 /cmd-select-layout.c | |
parent | de94a344f61b0e4ef6459c11621be3c3d1683c9e (diff) | |
download | rtmux-5f32b7d9613e9ef3f8198302379a42630323da6a.tar.gz rtmux-5f32b7d9613e9ef3f8198302379a42630323da6a.tar.bz2 rtmux-5f32b7d9613e9ef3f8198302379a42630323da6a.zip |
Hide struct args behind a couple of accessor functions.
Diffstat (limited to 'cmd-select-layout.c')
-rw-r--r-- | cmd-select-layout.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/cmd-select-layout.c b/cmd-select-layout.c index 7069eccc..f9a29047 100644 --- a/cmd-select-layout.c +++ b/cmd-select-layout.c @@ -105,24 +105,24 @@ cmd_select_layout_exec(struct cmd *self, struct cmdq_item *item) goto changed; } + if (args_count(args) != 0) + layoutname = args_string(args, 0); + else if (args_has(args, 'o')) + layoutname = oldlayout; + else + layoutname = NULL; + if (!args_has(args, 'o')) { - if (args->argc == 0) + if (layoutname == NULL) layout = w->lastlayout; else - layout = layout_set_lookup(args->argv[0]); + layout = layout_set_lookup(layoutname); if (layout != -1) { layout_set_select(w, layout); goto changed; } } - if (args->argc != 0) - layoutname = args->argv[0]; - else if (args_has(args, 'o')) - layoutname = oldlayout; - else - layoutname = NULL; - if (layoutname != NULL) { if (layout_parse(w, layoutname) == -1) { cmdq_error(item, "can't set layout: %s", layoutname); |