If there are only two panes, always use the other pane as the last

pane. Based on a change from Duy Nguyen in GitHub issue 1377.
pull/1385/head
nicm 2018-06-25 17:23:16 +00:00
parent dec6ec9e29
commit 0c94c3fbee
1 changed files with 5 additions and 0 deletions

View File

@ -69,6 +69,11 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
if (self->entry == &cmd_last_pane_entry || args_has(args, 'l')) {
lastwp = w->last;
if (lastwp == NULL && window_count_panes(w) == 2) {
lastwp = TAILQ_PREV(w->active, window_panes, entry);
if (lastwp == NULL)
lastwp = TAILQ_NEXT(w->active, entry);
}
if (lastwp == NULL) {
cmdq_error(item, "no last pane");
return (CMD_RETURN_ERROR);