summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2014-09-25 12:45:35 +0000
committernicm <nicm>2014-09-25 12:45:35 +0000
commit304f86cdbb5bf87f7a266e84c0f4fbd7bf25bb5e (patch)
tree0553608442c44ab58db57d480b7547d0a7dae2bf
parent21062d74d5373699aad9fe8d77bd5312a33e9834 (diff)
Support ! for last pane.
-rw-r--r--cmd.c8
-rw-r--r--tmux.17
2 files changed, 11 insertions, 4 deletions
diff --git a/cmd.c b/cmd.c
index 185d39b7..ff362757 100644
--- a/cmd.c
+++ b/cmd.c
@@ -1192,7 +1192,13 @@ cmd_find_pane(struct cmd_q *cmdq,
*wpp = wl->window->active;
else if (paneptr[0] == '+' || paneptr[0] == '-')
*wpp = cmd_find_pane_offset(paneptr, wl);
- else {
+ else if (paneptr[0] == '!' && paneptr[1] == '\0') {
+ if (wl->window->last == NULL) {
+ cmdq_error(cmdq, "no last pane");
+ goto error;
+ }
+ *wpp = wl->window->last;
+ } else {
idx = strtonum(paneptr, 0, INT_MAX, &errstr);
if (errstr != NULL)
goto lookup_string;
diff --git a/tmux.1 b/tmux.1
index 4e86e9c1..7f8e0ba2 100644
--- a/tmux.1
+++ b/tmux.1
@@ -435,10 +435,11 @@ first attempts to use the argument as a pane index; if that fails, it is looked
up as for
.Ar target-window .
A
-.Ql +
-or
+.Ql + ,
.Ql -
-indicate the next or previous pane index, respectively.
+or
+.Ql \&!
+indicate the next, previous or last pane.
One of the strings
.Em top ,
.Em bottom ,