diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-09-05 10:14:21 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-09-05 10:14:21 +0000 |
commit | b2a9f4115f99f88a8b69a36a1f9ab12f6de4a986 (patch) | |
tree | fedd6914c02a374258acad7221b226871a06dd1f | |
parent | b433886840ec4dba4b8b921b741b6a448a226d30 (diff) |
Handle empty list properly in choose-list, based on fix from Thomas Adam.
-rw-r--r-- | cmd-choose-list.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd-choose-list.c b/cmd-choose-list.c index 15c644ec..4c32e694 100644 --- a/cmd-choose-list.c +++ b/cmd-choose-list.c @@ -86,6 +86,12 @@ cmd_choose_list_exec(struct cmd *self, struct cmd_ctx *ctx) } free(copy); + if (idx == 0) { + free(template); + window_pane_reset_mode(wl->window->active); + return (CMD_RETURN_ERROR); + } + window_choose_ready(wl->window->active, 0, cmd_choose_list_callback, cmd_choose_list_free); |