From 9e069a310d14f9b6ebbe6e3747240e7844d9ffcb Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 20 Jun 2026 10:51:51 -0400 Subject: fix(windows): keep the pulled-away window on the arrow's edge The sole-window pull split toward the arrow at 50/50, so a fullscreen terminal jumped above the revealed buffer at half height. Now the reveal opens on the opposite side and is minimized to a sliver, so the current window keeps the arrow's edge near-full and the sticky windsize arrows shrink it step by step, matching the feel of resizing an existing split. --- tests/test-ui-navigation--window-resize.el | 34 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/test-ui-navigation--window-resize.el b/tests/test-ui-navigation--window-resize.el index 986ce1580..553219755 100644 --- a/tests/test-ui-navigation--window-resize.el +++ b/tests/test-ui-navigation--window-resize.el @@ -44,24 +44,26 @@ otherwise route to the pull-away path." (should ran) ; dispatched to the right command (should overriding-terminal-local-map)))) ; loop armed -(ert-deftest test-ui-navigation-window-arrow-direction () - "Normal/Error: each arrow maps to its split direction; anything else is nil." - (should (eq (cj/window-arrow-direction "") 'left)) - (should (eq (cj/window-arrow-direction "") 'right)) - (should (eq (cj/window-arrow-direction "") 'above)) - (should (eq (cj/window-arrow-direction "") 'below)) - (should (null (cj/window-arrow-direction ""))) - (should (null (cj/window-arrow-direction "x")))) +(ert-deftest test-ui-navigation-window-pull-side () + "Normal/Error: each arrow maps to the *opposite* side (where the revealed +window opens, so the current window keeps the arrow's edge); anything else +is nil." + (should (eq (cj/window-pull-side "") 'above)) + (should (eq (cj/window-pull-side "") 'below)) + (should (eq (cj/window-pull-side "") 'right)) + (should (eq (cj/window-pull-side "") 'left)) + (should (null (cj/window-pull-side ""))) + (should (null (cj/window-pull-side "x")))) (ert-deftest test-ui-navigation-window-resize-sticky-sole-window-pulls-away () - "Normal: with a single window, the arrow pulls a window away toward its -direction (via `cj/window--pull-away') rather than resizing, then arms the -loop. `cj/window--pull-away' is stubbed to capture the direction so no real -window split happens under `--batch'." - (dolist (case '((left . left) - (right . right) - (up . above) - (down . below))) + "Normal: with a single window, the arrow pulls a sliver away on the side +opposite the arrow (via `cj/window--pull-away') rather than resizing, then +arms the loop. `cj/window--pull-away' is stubbed to capture the side so no +real window split happens under `--batch'." + (dolist (case '((down . above) + (up . below) + (left . right) + (right . left))) (let ((pulled nil) (overriding-terminal-local-map nil) (pre-command-hook nil)) -- cgit v1.2.3