Preserve marked pane with swap-window and move-window, GitHub issue 3443.

This commit is contained in:
nicm
2025-10-30 13:52:08 +00:00
parent 29db8ac36e
commit e774b89062
2 changed files with 4 additions and 0 deletions

View File

@@ -77,6 +77,8 @@ cmd_swap_window_exec(struct cmd *self, struct cmdq_item *item)
wl_src->window = w_dst; wl_src->window = w_dst;
TAILQ_INSERT_TAIL(&w_dst->winlinks, wl_src, wentry); TAILQ_INSERT_TAIL(&w_dst->winlinks, wl_src, wentry);
if (marked_pane.wl == wl_src)
marked_pane.wl = wl_dst;
if (args_has(args, 'd')) { if (args_has(args, 'd')) {
session_select(dst, wl_dst->idx); session_select(dst, wl_dst->idx);
if (src != dst) if (src != dst)

View File

@@ -289,6 +289,8 @@ server_link_window(struct session *src, struct winlink *srcwl,
if (dstwl == NULL) if (dstwl == NULL)
return (-1); return (-1);
if (marked_pane.wl == srcwl)
marked_pane.wl = dstwl;
if (selectflag) if (selectflag)
session_select(dst, dstwl->idx); session_select(dst, dstwl->idx);
server_redraw_session_group(dst); server_redraw_session_group(dst);