mirror of
https://github.com/tmux/tmux.git
synced 2024-11-16 17:39:09 +00:00
Kill empty window after moving pane and updating current window, so that
index is still valid before renumber-windows happens. Fixes issue reported by Eric Pruitt.
This commit is contained in:
parent
6bf033beae
commit
537964b92d
@ -136,11 +136,6 @@ join_pane(struct cmd *self, struct cmd_q *cmdq, int not_same_window)
|
|||||||
window_lost_pane(src_w, src_wp);
|
window_lost_pane(src_w, src_wp);
|
||||||
TAILQ_REMOVE(&src_w->panes, src_wp, entry);
|
TAILQ_REMOVE(&src_w->panes, src_wp, entry);
|
||||||
|
|
||||||
if (window_count_panes(src_w) == 0)
|
|
||||||
server_kill_window(src_w);
|
|
||||||
else
|
|
||||||
notify_window_layout_changed(src_w);
|
|
||||||
|
|
||||||
src_wp->window = dst_w;
|
src_wp->window = dst_w;
|
||||||
TAILQ_INSERT_AFTER(&dst_w->panes, dst_wp, src_wp, entry);
|
TAILQ_INSERT_AFTER(&dst_w->panes, dst_wp, src_wp, entry);
|
||||||
layout_assign_pane(lc, src_wp);
|
layout_assign_pane(lc, src_wp);
|
||||||
@ -157,6 +152,11 @@ join_pane(struct cmd *self, struct cmd_q *cmdq, int not_same_window)
|
|||||||
} else
|
} else
|
||||||
server_status_session(dst_s);
|
server_status_session(dst_s);
|
||||||
|
|
||||||
|
if (window_count_panes(src_w) == 0)
|
||||||
|
server_kill_window(src_w);
|
||||||
|
else
|
||||||
|
notify_window_layout_changed(src_w);
|
||||||
notify_window_layout_changed(dst_w);
|
notify_window_layout_changed(dst_w);
|
||||||
|
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user