mirror of
https://github.com/tmux/tmux.git
synced 2026-10-06 17:49:52 +00:00
Do nothing if move-pane -P does not change the pane.
This commit is contained in:
@@ -128,7 +128,7 @@ cmd_join_pane_place(struct cmdq_item *item, struct winlink *wl,
|
|||||||
{
|
{
|
||||||
struct window *w = wl->window;
|
struct window *w = wl->window;
|
||||||
struct layout_cell *lc = wp->layout_cell;
|
struct layout_cell *lc = wp->layout_cell;
|
||||||
struct window_pane *owp;
|
struct window_pane *owp, *prev;
|
||||||
int wx = w->sx, wy = w->sy;
|
int wx = w->sx, wy = w->sy;
|
||||||
int px = lc->g.sx, py = lc->g.sy;
|
int px = lc->g.sx, py = lc->g.sy;
|
||||||
int xoff = lc->g.xoff, yoff = lc->g.yoff;
|
int xoff = lc->g.xoff, yoff = lc->g.yoff;
|
||||||
@@ -136,6 +136,7 @@ cmd_join_pane_place(struct cmdq_item *item, struct winlink *wl,
|
|||||||
|
|
||||||
if (window_pane_get_pane_lines(wp) == PANE_LINES_NONE)
|
if (window_pane_get_pane_lines(wp) == PANE_LINES_NONE)
|
||||||
border = 0;
|
border = 0;
|
||||||
|
prev = TAILQ_PREV(wp, window_panes_zindex, zentry);
|
||||||
|
|
||||||
if (strcmp(position, "top-left") == 0) {
|
if (strcmp(position, "top-left") == 0) {
|
||||||
xoff = border;
|
xoff = border;
|
||||||
@@ -220,6 +221,11 @@ cmd_join_pane_place(struct cmdq_item *item, struct winlink *wl,
|
|||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Do nothing if the pane did not move, as when raising the top pane. */
|
||||||
|
if (xoff == lc->g.xoff && yoff == lc->g.yoff &&
|
||||||
|
TAILQ_PREV(wp, window_panes_zindex, zentry) == prev)
|
||||||
|
return (CMD_RETURN_NORMAL);
|
||||||
|
|
||||||
if (xoff != lc->g.xoff || yoff != lc->g.yoff) {
|
if (xoff != lc->g.xoff || yoff != lc->g.yoff) {
|
||||||
lc->g.xoff = xoff;
|
lc->g.xoff = xoff;
|
||||||
lc->g.yoff = yoff;
|
lc->g.yoff = yoff;
|
||||||
|
|||||||
Reference in New Issue
Block a user