mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Better error reporting when applying custom layouts.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user