diff options
author | nicm <nicm> | 2018-06-25 17:23:16 +0000 |
---|---|---|
committer | nicm <nicm> | 2018-06-25 17:23:16 +0000 |
commit | 0c94c3fbee3df39293de8b7fd957392251113a74 (patch) | |
tree | b100507308d6e6b1b159e52d696d1b9c44951d94 | |
parent | dec6ec9e29033cb4739b9eec5f3a5c68dece878a (diff) | |
download | rtmux-0c94c3fbee3df39293de8b7fd957392251113a74.tar.gz rtmux-0c94c3fbee3df39293de8b7fd957392251113a74.tar.bz2 rtmux-0c94c3fbee3df39293de8b7fd957392251113a74.zip |
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.
-rw-r--r-- | cmd-select-pane.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd-select-pane.c b/cmd-select-pane.c index 790a1a5b..a2345fe1 100644 --- a/cmd-select-pane.c +++ b/cmd-select-pane.c @@ -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); |