aboutsummaryrefslogtreecommitdiff
path: root/tests/test-vterm-toggle--dispatch.el
Commit message (Collapse)AuthorAgeFilesLines
* refactor: split eshell-vterm-config into eshell-config and vterm-configCraig Jennings2026-05-101-1/+1
| | | | | | The combined module had grown to 573 lines covering two unrelated subsystems with no shared state — the eshell shell-mode commands and the vterm/F12 toggle. The header even rendered this with two `;; ----` dividers. Split into two focused modules. eshell-config.el keeps the eshell user commands and package wiring (~170 lines). vterm-config.el keeps the vterm package, the tmux history capture command, the F12 toggle, and the C-; V keymap (~400 lines). Update init.el to require both, point the four vterm test files at vterm-config, and refresh the cross-module commentary in cj-window-geometry.el and cj-window-toggle.el. No behavior change. Full test suite green; validate-modules clean.
* refactor(tests): extract shared buffer-cleanup and fake-vterm helpersCraig Jennings2026-05-091-9/+4
| | | | | | | | | | | | | | Eight test files across the ai-vterm and vterm-toggle suites each shipped a small variant of the same cleanup loop: walk `buffer-list`, kill any buffer whose name starts with a given prefix. Each file also re-implemented the `(string-prefix-p ...)` check inline. One file additionally had its own fake-vterm-mode-buffer constructor for tests that needed `cj/--vterm-toggle-buffer-p` to fire. I pulled the shared logic into `tests/testutil-vterm-buffers.el`: - `cj/test--kill-buffers-matching-prefix` is the primitive. - `cj/test--kill-claude-buffers` and `cj/test--kill-test-vterm-buffers` are thin wrappers for the two prefixes that actually appear. - `cj/test--make-fake-vterm-buffer` constructs a buffer with `major-mode` set to `vterm-mode` without launching a real vterm process. Each affected test file now `(require 'testutil-vterm-buffers)` and calls the shared helpers directly. `test-vterm-toggle--buffer-filter.el` keeps a 3-line wrapper that calls both kill helpers in sequence (the only place that needs both prefixes). Net diff: -116 / +72 across 8 test files, plus ~30 lines in the new testutil. Roughly -45 lines after the abstraction is paid for. No behavior change. 80 ai-vterm tests, 15 vterm-toggle tests, 15 cj-window-geometry tests all pass. Full make test green.
* feat(vterm): F12 toggle that excludes claude and preserves geometryCraig Jennings2026-05-091-0/+58
vterm-toggle picked the most-recently-selected vterm buffer as F12's toggle target. After using F9 on a claude vterm, the most-recent vterm IS claude, so F12 ended up toggling claude, which has its own F9 / C-F9 / M-F9 surface in ai-vterm.el and shouldn't be affected. The display rule also had a hard-coded `(window-height . 0.7)` that overrode mouse-resize and orientation flips on every toggle. I replaced the F12 binding with `cj/vterm-toggle` in `eshell-vterm-config.el`, mirroring the pattern shipped in ai-vterm.el: - `cj/--vterm-toggle-buffer-p` excludes claude-prefixed buffers from F12's candidate set. - `cj/--vterm-toggle-capture-state` records direction + body size at toggle-off. - `cj/--vterm-toggle-display-saved` replays via `(body-columns . N)` / `(body-lines . N)` cons forms with the cardinal direction mapped to its frame-edge variant (`right` -> `rightmost`, `below` -> `bottom`, etc.) so vterm always lands at the captured edge regardless of selected window. - `cj/vterm-toggle` uses `delete-window` (with `one-window-p` guard) on toggle-off so buffer-move scenarios don't leak ghost windows. Default direction is `'below` to match F12's traditional bottom split. The vterm-toggle package stays installed so `M-x vterm-toggle` still works. Only the F12 binding changes. 19 new tests across three files: buffer-filter, dispatch, display. Full make test green. Tradeoff: ~150 lines of geometry helpers and capture/display action logic are duplicated from ai-vterm.el. Worth extracting into a shared module now that two consumers exist. I filed it as a follow-up rather than blocking this ship.