Correctly clip left of panes.

This commit is contained in:
Nicholas Marriott
2026-06-21 20:22:28 +01:00
parent 619f3d3156
commit 1c579d7ef1
7 changed files with 81 additions and 6 deletions

View File

@@ -58,6 +58,11 @@ tile_2x2() {
$TMUX2 select-layout tiled || exit 1 $TMUX2 select-layout tiled || exit 1
} }
# fill_base_pattern: make clipped floating panes visibly cover every column.
fill_base_pattern() {
$TMUX2 respawnp -k "sh -c 'i=0; while [ \$i -lt 12 ]; do printf \"%02d:abcdefghijklmnopqrstuvwxyz0123456789\n\" \$i; i=\$((i + 1)); done; exec sleep 100'" || exit 1
}
$TMUX kill-server 2>/dev/null $TMUX kill-server 2>/dev/null
$TMUX2 kill-server 2>/dev/null $TMUX2 kill-server 2>/dev/null
@@ -118,6 +123,28 @@ new_scene 40 12
$TMUX2 new-pane -x18 -y6 -X-4 -Y-2 "sh -c 'printf TL; exec sleep 100'" || exit 1 $TMUX2 new-pane -x18 -y6 -X-4 -Y-2 "sh -c 'printf TL; exec sleep 100'" || exit 1
compare floating-clip-topleft compare floating-clip-topleft
# Floating panes clipped at each edge. The patterned base pane makes sure the
# clipped edge still obscures both content and borders underneath.
new_scene 40 12
fill_base_pattern
$TMUX2 new-pane -x20 -y6 -X-10 -Y3 "sh -c 'printf LEFT; exec sleep 100'" || exit 1
compare floating-clip-left
new_scene 40 12
fill_base_pattern
$TMUX2 new-pane -x20 -y6 -X30 -Y3 "sh -c 'printf RIGHT; exec sleep 100'" || exit 1
compare floating-clip-right
new_scene 40 12
fill_base_pattern
$TMUX2 new-pane -x20 -y6 -X10 -Y-3 "sh -c 'printf TOP; exec sleep 100'" || exit 1
compare floating-clip-top
new_scene 40 12
fill_base_pattern
$TMUX2 new-pane -x20 -y6 -X10 -Y9 "sh -c 'printf BOTTOM; exec sleep 100'" || exit 1
compare floating-clip-bottom
# Floating pane over a tiled 2x2 grid: the float draws a complete box and must # Floating pane over a tiled 2x2 grid: the float draws a complete box and must
# NOT merge its borders with the tiled pane borders underneath. # NOT merge its borders with the tiled pane borders underneath.
new_scene 40 12 new_scene 40 12

View File

@@ -0,0 +1,12 @@
01:abcdefghijklmnopqrstuvwxyz0123456789
02:abcdefghijklmnopqrstuvwxyz0123456789
03:abcdefghijklmnopqrstuvwxyz0123456789
04:abcdefghijklmnopqrstuvwxyz0123456789
05:abcdefghijklmnopqrstuvwxyz0123456789
06:abcdefghijklmnopqrstuvwxyz0123456789
07:abcdefghijklmnopqrstuvwxyz0123456789
08:abcdefghijklmnopqrstuvwxyz0123456789
09:abcdef┌────────────────────┐23456789
10:abcdef│BOTTOM │23456789
11:abcdef│ │23456789
│ │

View File

@@ -0,0 +1,12 @@
01:abcdefghijklmnopqrstuvwxyz0123456789
02:abcdefghijklmnopqrstuvwxyz0123456789
──────────┐ijklmnopqrstuvwxyz0123456789
│ijklmnopqrstuvwxyz0123456789
│ijklmnopqrstuvwxyz0123456789
│ijklmnopqrstuvwxyz0123456789
│ijklmnopqrstuvwxyz0123456789
│ijklmnopqrstuvwxyz0123456789
│ijklmnopqrstuvwxyz0123456789
──────────┘ijklmnopqrstuvwxyz0123456789
11:abcdefghijklmnopqrstuvwxyz0123456789

View File

@@ -0,0 +1,12 @@
01:abcdefghijklmnopqrstuvwxyz0123456789
02:abcdefghijklmnopqrstuvwxyz0123456789
03:abcdefghijklmnopqrstuvwxyz┌──────────
04:abcdefghijklmnopqrstuvwxyz│RIGHT
05:abcdefghijklmnopqrstuvwxyz│
06:abcdefghijklmnopqrstuvwxyz│
07:abcdefghijklmnopqrstuvwxyz│
08:abcdefghijklmnopqrstuvwxyz│
09:abcdefghijklmnopqrstuvwxyz│
10:abcdefghijklmnopqrstuvwxyz└──────────
11:abcdefghijklmnopqrstuvwxyz0123456789

View File

@@ -0,0 +1,12 @@
01:abcdef│ │23456789
02:abcdef│ │23456789
03:abcdef│ │23456789
04:abcdef└────────────────────┘23456789
05:abcdefghijklmnopqrstuvwxyz0123456789
06:abcdefghijklmnopqrstuvwxyz0123456789
07:abcdefghijklmnopqrstuvwxyz0123456789
08:abcdefghijklmnopqrstuvwxyz0123456789
09:abcdefghijklmnopqrstuvwxyz0123456789
10:abcdefghijklmnopqrstuvwxyz0123456789
11:abcdefghijklmnopqrstuvwxyz0123456789

View File

@@ -1,8 +1,8 @@
base
─────────────┘
──────────────┘

View File

@@ -358,11 +358,11 @@ redraw_pane_to_scene(struct redraw_build_ctx *bctx, struct window_pane *wp,
top = wp->yoff - 1; top = wp->yoff - 1;
bottom = wp->yoff + wp->sy; bottom = wp->yoff + wp->sy;
if (left < 0 && wx <= 0) if (left < 0 && wx < 0)
return (0); return (0);
if (right > (int)bctx->w->sx && wx >= (int)bctx->w->sx) if (right > (int)bctx->w->sx && wx >= (int)bctx->w->sx)
return (0); return (0);
if (top < 0 && wy <= 0) if (top < 0 && wy < 0)
return (0); return (0);
if (bottom > (int)bctx->w->sy && wy >= (int)bctx->w->sy) if (bottom > (int)bctx->w->sy && wy >= (int)bctx->w->sy)
return (0); return (0);
@@ -685,11 +685,11 @@ redraw_mark_pane_borders(struct redraw_build_ctx *bctx, struct window_pane *wp,
if (floating) { if (floating) {
if (left < 0) if (left < 0)
left = 1; left = 0;
if (right > (int)bctx->w->sx) if (right > (int)bctx->w->sx)
right = (int)bctx->w->sx - 1; right = (int)bctx->w->sx - 1;
if (top < 0) if (top < 0)
top = 1; top = 0;
if (bottom > (int)bctx->w->sy) if (bottom > (int)bctx->w->sy)
bottom = (int)bctx->w->sy - 1; bottom = (int)bctx->w->sy - 1;
} else { } else {