aboutsummaryrefslogtreecommitdiff
path: root/tests/test-term-toggle--display.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-20 02:46:52 -0400
committerCraig Jennings <c@cjennings.net>2026-06-20 02:46:52 -0400
commit0b0a8e577dd5c964753f90df96d726f3bf01f830 (patch)
tree8aa8dc502ccb9654420c8b98d3e22d7b84757625 /tests/test-term-toggle--display.el
parent945ab911f82b36dcc8d0c9a3b01e9d7b06851d68 (diff)
downloaddotemacs-0b0a8e577dd5c964753f90df96d726f3bf01f830.tar.gz
dotemacs-0b0a8e577dd5c964753f90df96d726f3bf01f830.zip
feat(windows): dock companion panels by a shared min-column rule
The F9 agent always docked as a right-side column on a landscape frame. On this 138-column frame that left ~68-column panes, too cramped to read code and the agent side by side. The F12 terminal and F10 playlist hardcoded a bottom split with no width-aware path. I added cj/preferred-dock-direction and the cj/window-dock-min-columns defcustom (default 80) to the window-geometry lib: dock side-by-side only when the narrower pane keeps at least the minimum width, otherwise stack below. All three toggles now route through it. F9 drops its pixel-aspect rule. F12 and F10 gain a right-column width default and become adaptive. F10 keeps width and height size memory in separate vars so a resize on one axis doesn't leak to the other.
Diffstat (limited to 'tests/test-term-toggle--display.el')
-rw-r--r--tests/test-term-toggle--display.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test-term-toggle--display.el b/tests/test-term-toggle--display.el
index 0943a4888..7fa7f0a98 100644
--- a/tests/test-term-toggle--display.el
+++ b/tests/test-term-toggle--display.el
@@ -83,5 +83,29 @@
received-alist)))
(should (null wh-cells)))))
+(ert-deftest test-term-toggle--default-size-pairs-width-with-right ()
+ "Normal: the default size for `right' is the width fraction."
+ (let ((cj/term-toggle-window-width 0.5)
+ (cj/term-toggle-window-height 0.7))
+ (should (= (cj/--term-toggle-default-size 'right) 0.5))))
+
+(ert-deftest test-term-toggle--default-size-pairs-height-with-below ()
+ "Normal: the default size for `below' is the height fraction."
+ (let ((cj/term-toggle-window-width 0.5)
+ (cj/term-toggle-window-height 0.7))
+ (should (= (cj/--term-toggle-default-size 'below) 0.7))))
+
+(ert-deftest test-term-toggle--default-direction-delegates-to-dock-rule ()
+ "Normal: default-direction passes the width fraction to the dock rule."
+ (let ((cj/term-toggle-window-width 0.5)
+ captured)
+ (cl-letf (((symbol-function 'cj/preferred-dock-direction)
+ (lambda (cols frac &rest _)
+ (setq captured (list cols frac))
+ 'right)))
+ (should (eq (cj/--term-toggle-default-direction) 'right))
+ (should (= (nth 1 captured) 0.5))
+ (should (integerp (nth 0 captured))))))
+
(provide 'test-term-toggle--display)
;;; test-term-toggle--display.el ends here