mirror of
https://github.com/tmux/tmux.git
synced 2026-06-23 08:27:08 +00:00
Correctly clip left of panes.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
12
regress/screen-redraw-results/floating-clip-bottom.result
Normal file
12
regress/screen-redraw-results/floating-clip-bottom.result
Normal 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
|
||||||
|
│ │
|
||||||
12
regress/screen-redraw-results/floating-clip-left.result
Normal file
12
regress/screen-redraw-results/floating-clip-left.result
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
01:abcdefghijklmnopqrstuvwxyz0123456789
|
||||||
|
02:abcdefghijklmnopqrstuvwxyz0123456789
|
||||||
|
──────────┐ijklmnopqrstuvwxyz0123456789
|
||||||
|
│ijklmnopqrstuvwxyz0123456789
|
||||||
|
│ijklmnopqrstuvwxyz0123456789
|
||||||
|
│ijklmnopqrstuvwxyz0123456789
|
||||||
|
│ijklmnopqrstuvwxyz0123456789
|
||||||
|
│ijklmnopqrstuvwxyz0123456789
|
||||||
|
│ijklmnopqrstuvwxyz0123456789
|
||||||
|
──────────┘ijklmnopqrstuvwxyz0123456789
|
||||||
|
11:abcdefghijklmnopqrstuvwxyz0123456789
|
||||||
|
|
||||||
12
regress/screen-redraw-results/floating-clip-right.result
Normal file
12
regress/screen-redraw-results/floating-clip-right.result
Normal 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
|
||||||
|
|
||||||
12
regress/screen-redraw-results/floating-clip-top.result
Normal file
12
regress/screen-redraw-results/floating-clip-top.result
Normal 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
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
base
|
|
||||||
│
|
│
|
||||||
│
|
│
|
||||||
│
|
│
|
||||||
─────────────┘
|
│
|
||||||
|
──────────────┘
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user