diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2022-04-06 14:41:44 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2022-04-06 14:41:44 +0100 |
commit | 996e54763c04749860532a0d6b7df0d75671a405 (patch) | |
tree | 4d4d2fd085daf4d6b622b0423cef14fc2e6ca542 /cmd-select-layout.c | |
parent | 18105c8ecb901c72040db09f58585503a8409fd0 (diff) |
Better error reporting when applying custom layouts.
Diffstat (limited to 'cmd-select-layout.c')
-rw-r--r-- | cmd-select-layout.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd-select-layout.c b/cmd-select-layout.c index c857a0e1..6dfe2b6a 100644 --- a/cmd-select-layout.c +++ b/cmd-select-layout.c @@ -77,7 +77,7 @@ cmd_select_layout_exec(struct cmd *self, struct cmdq_item *item) struct window *w = wl->window; struct window_pane *wp = target->wp; const char *layoutname; - char *oldlayout; + char *oldlayout, *cause; int next, previous, layout; server_unzoom_window(w); @@ -124,8 +124,9 @@ cmd_select_layout_exec(struct cmd *self, struct cmdq_item *item) } if (layoutname != NULL) { - if (layout_parse(w, layoutname) == -1) { - cmdq_error(item, "can't set layout: %s", layoutname); + if (layout_parse(w, layoutname, &cause) == -1) { + cmdq_error(item, "%s: %s", cause, layoutname); + free(cause); goto error; } goto changed; |