diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-27 18:26:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-27 18:26:58 -0500 |
| commit | 73f7656d02f916c361fc0da06d97d9bdaf9062a0 (patch) | |
| tree | 5b3f3e4a1412462ce888b65829e4312f3dfc670f /tests/test-pearl-compose.el | |
| parent | 34b4e5ecd8468129cb97e870987fc8bb8d27d6e2 (diff) | |
| download | pearl-73f7656d02f916c361fc0da06d97d9bdaf9062a0.tar.gz pearl-73f7656d02f916c361fc0da06d97d9bdaf9062a0.zip | |
feat(compose): open compose and conflict buffers in a configurable side window
The compose buffers (edit-description, add-comment) and the smerge conflict buffer popped wherever display-buffer happened to put them. Now they open in a side window, defaulting to the bottom at 30% of the frame, with two defcustoms to control it: pearl-compose-window-side (bottom / top / left / right) and pearl-compose-window-size (a fraction of the frame, or an absolute line/column count). pearl--compose-display-action builds the display-buffer-in-side-window action and both pop sites pass it through pop-to-buffer, so Pearl always applies the side window over any display-buffer-alist entry for these buffers.
Diffstat (limited to 'tests/test-pearl-compose.el')
| -rw-r--r-- | tests/test-pearl-compose.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test-pearl-compose.el b/tests/test-pearl-compose.el index 7029297..3e62c09 100644 --- a/tests/test-pearl-compose.el +++ b/tests/test-pearl-compose.el @@ -149,5 +149,28 @@ Binds `captured' to the value the on-finish receives (or `:none'). Stubs (goto-char (point-min)) (should (re-search-forward "Edited description" nil t)))))) +;;; compose-window display action + +(ert-deftest test-pearl-compose-display-action-defaults-to-bottom-fraction () + "By default the compose window opens at the bottom, sized to 30% of the frame." + (should (equal '((display-buffer-in-side-window) (side . bottom) (window-height . 0.3)) + (pearl--compose-display-action)))) + +(ert-deftest test-pearl-compose-display-action-honors-side-and-size () + "The side and size defcustoms drive the action; left/right size the width, +top/bottom the height, and the size passes through as float or integer." + (let ((pearl-compose-window-side 'right) + (pearl-compose-window-size 40)) + (should (equal '((display-buffer-in-side-window) (side . right) (window-width . 40)) + (pearl--compose-display-action)))) + (let ((pearl-compose-window-side 'top) + (pearl-compose-window-size 0.25)) + (should (equal '((display-buffer-in-side-window) (side . top) (window-height . 0.25)) + (pearl--compose-display-action)))) + (let ((pearl-compose-window-side 'left) + (pearl-compose-window-size 0.2)) + (should (equal '((display-buffer-in-side-window) (side . left) (window-width . 0.2)) + (pearl--compose-display-action))))) + (provide 'test-pearl-compose) ;;; test-pearl-compose.el ends here |
