From 299b7289ea9b5ae9d5cccc57a87e6c26eb24b181 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 9 May 2019 08:38:13 +0000 Subject: Add formats to show if pane is the marked pane and if any marked pane is set. --- format.c | 6 ++++++ tmux.1 | 2 ++ 2 files changed, 8 insertions(+) diff --git a/format.c b/format.c index a3a58d92..febf160b 100644 --- a/format.c +++ b/format.c @@ -2036,6 +2036,12 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp) else format_add(ft, "pane_dead", "0"); + if (server_check_marked() && marked_pane.wp == wp) + format_add(ft, "pane_marked", "1"); + else + format_add(ft, "pane_marked", "0"); + format_add(ft, "pane_marked_set", "%d", server_check_marked()); + format_add(ft, "pane_left", "%u", wp->xoff); format_add(ft, "pane_top", "%u", wp->yoff); format_add(ft, "pane_right", "%u", wp->xoff + wp->sx - 1); diff --git a/tmux.1 b/tmux.1 index daaeadbe..fcc1b9c1 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3969,6 +3969,8 @@ The following variables are available, where appropriate: .It Li "pane_input_off" Ta "" Ta "If input to pane is disabled" .It Li "pane_index" Ta "#P" Ta "Index of pane" .It Li "pane_left" Ta "" Ta "Left of pane" +.It Li "pane_marked" Ta " Ta "1 if this is the marked pane" +.It Li "pane_marked_set" Ta " Ta "1 if a market pane is set" .It Li "pane_mode" Ta "" Ta "Name of pane mode, if any." .It Li "pane_pid" Ta "" Ta "PID of first process in pane" .It Li "pane_pipe" Ta "" Ta "1 if pane is being piped" -- cgit From 3c68e51609d35189e46d9b14c2a489a5ca3de67e Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 9 May 2019 08:39:09 +0000 Subject: Change swap-window -d to be the other way round (stay with src window), so it works like swap-pane. --- cmd-swap-window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd-swap-window.c b/cmd-swap-window.c index 39670e3c..f5224194 100644 --- a/cmd-swap-window.c +++ b/cmd-swap-window.c @@ -78,9 +78,9 @@ cmd_swap_window_exec(struct cmd *self, struct cmdq_item *item) TAILQ_INSERT_TAIL(&w_dst->winlinks, wl_src, wentry); if (!args_has(self->args, 'd')) { - session_select(dst, wl_dst->idx); + session_select(src, wl_src->idx); if (src != dst) - session_select(src, wl_src->idx); + session_select(dst, wl_dst->idx); } session_group_synchronize_from(src); server_redraw_session_group(src); -- cgit