diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-26 02:19:41 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-26 03:56:56 -0300 |
| commit | ac39b5e4f80e1903abccd1e003850e9691e61022 (patch) | |
| tree | 508ead9677839dd67dd82930099388e6dc0b421a /test/process/tty_editing.zig | |
| parent | 13d234f431a98bf97fcc1caec812f59eff711aa0 (diff) | |
| download | pardes-ac39b5e4f80e1903abccd1e003850e9691e61022.tar.gz pardes-ac39b5e4f80e1903abccd1e003850e9691e61022.zip | |
tagline, layout, draw, mouse, edit, dump: one column, one row: the window row holds the lone column's words at its left (`New Term`) and the window's at its right end (`Find Grep Newcol Help Exit`, then `Restore <dump>`, then the user's text), and the column-tag row comes only with a second column (`New Term Joincol Delcol` over each), or a column tag holding the user's text (UX DESIGN K'2, binding; the user: "I liked C and D for the tagline like we could show the column tagline only when we have multiple columns"); THE OLD WAY: the window's and every column's tag were a row each whatever the window held, 2 of 20 rows at the demo's 84x20 before a line of text, their words their own text (`global_tag.own`, `col_tags[c].own`, or until edited the defaults `Newcol Joincol Find Grep Help Changelog Tutor Dump Themes [Fonts] Config History Debug Exit` and `New Term Find Grep Joincol Delcol`), and Restore's word swapped inside the window's own text (Core.pointRestoreAt); THE CHANGE: a header reads as a pane tag does since K'1, computed words, a blank, then the user's text (tagline.headerWords, headerText; config.window_words_str, column_words_str, columns_words_str; the old lists kept for the dumps and for /tagexec's refusal of pane words, ninep/cols.zig paneWord), the words read-only (edit.setEditTextSpan refuses an edit that changes them and their blank, editText edits the text as shown, flatSurface shows it), the keyboard starting on the user's text (enterHeader, as enterTag), Restore computed (pointRestoreAt keeps only the path); layout.columnBarHeight is 0 with one column and no column tag holding text (and with a window row to take the lone column's words: a native shell's window with none keeps the column row), layout.columnInWindowRow says the lone column's tag is in the window row; tagline.windowRow is the one rule for the window row's two sides, in cells (the column's text and its caret's cell from the inset; the window's text right-aligned, its caret's cell at the right edge, a server's progress after its text while one runs, tagline.sessionProgress; cells from glyphs by layout.tagCapacity's inverse), read by draw.zig (addRegions: a `.column_tag` region for column 0 in the window row, no grip; paintHeaders: the window row on the tagline's ground end to end, column 0's layer at its left in the row's inks, the window's layer from its words), mouse.zig (headerPoint and the press: the column's side, the window's, the blank between no one's), workspaceBlank (the inset and the blank between are the pixel shell's drag area) and root.zig's pixel grid (taglineOriginCol, gridColAt, the macOS fallback); Core.sync lets a column tag keep the keyboard in the window row; revealHeader scrolls each by its own side's width; flattenHeaders keeps the caret on its character in the text as shown; a 9P header write appends to the user's text and a truncation clears it, the words staying (ninep/cols.zig); Help's `topbar` annotation names the window row's words (root.zig shortcuts; docs/typ/builtins-tui.json from `zig build builtins-json`, builtins-gui.json the same 9 lines by hand); RESTORE: dump.dropOldTags also drops a window tag's own text equal to the old row (either build's, with or without its `Restore <path>`) and a column's equal to the old column tag, any other kept as the user's text; A FAULT THE ROW FOUND (core-test, ninep/tree.zig "random placements ... leave no pane under its tag and two rows", seed 30, 8 rows: Newcol with two panes at their minimum left `pane 2 h 2 min 3`): layout.keepColumn's trial shares a column's rows out again for the new layout and, refused, dropped the column but kept the trial's shares, so the column's panes came back on the old height with the trial's weights, one under its minimum; a column row that comes with a second column now makes every refused Newcol in a full column take that path; THE FIX: keepColumn puts every pane's weight back when it refuses (a user could hit it before this change too, where a narrower column wrapped tags); TESTS (FIRST): layout.zig "the column row comes with a second column and goes with it, the panes giving it and taking it back; a column tag with the user's text keeps it (UX K'2)" (one column: no row, the pane at row 1; Newcol: the row, both columns' panes at row 2; Delcol of the second: the pane's rect back as it was; the user's text keeps the row alone, emptied it goes), mouse.zig "one column's words at the window row's left and the window's at its right each run their own; the blank between is no one's (UX K'2)" (windowRow's sides at 100 columns; B2 on New makes a pane in the column; B2 and B1 on the blank nothing; B1 on Term gives the column's tag the keyboard there, its caret on the cell; B2 on Newcol at the right a second column), tagline.zig "a header reads its computed words, then the user's text: typed there, kept through a change of its words (UX K'1, K'2)" (typed at the start, a Backspace into the words refused, Restore coming in before the user's text, Joincol Delcol into both columns' words with a second, Newcol's tag typed into), "a dump of a build before UX K' restores a header's old default own text as none, any other as the user's (UX K'1)" and "the window row is blank at its inset and between its two sides, and nowhere else (UX K'2)"; TESTS CHANGED, each for the row or a word that moved: Core.zig the Restore word (computed, the user's text after it, across a Restore), editable headers (a sweep over the window's words, `a` into them refused, typed after them; the column's tag typed into at the window row's left brings the column row, emptied it goes, the keyboard staying), topbar hover (each side's first word), the short screen (sync before presenting the user's text); tagline.zig flattening (the caret on `a` of Snarf in the text as shown); keys.zig (W4's file, the test only: `s` in the window tag finds `i` twice, Find and Exit); Handover.zig (a column carried by its grip: a second column first, the grip is in the column row); replica.zig (the kind's pane under one row of body: 4 rows, not 5); ninep/cols.zig (the column's and the window's tag read, cleared and appended to after their words); root.zig (the window row's blank on the body's grid, its words compact from their origin); dev/gui/gui.zig (L2cde's file, the test only: the window's text starts at windowRow's words); test/panes.zig (a header's click past its words), test/column_drag.zig (the tags compared by their own text: columnTag now builds in the step's scratch), test/hxdiff.zig (25 rows give helix's 22: one row of chrome less); BEHAVIOUR: columns_and_tags (the window's words at the row's right end; a lone column's tag `New Term `; a click past it on its caret's cell types the user's text and brings the column row, the pane's tag under it, and a wider run of 界 to scroll it; Help, not Tutor, for Tab from the window's tag; a column tag typed into after its words), keys (zz at 80x24 for a view of 21 rows), modes (`b` from the column tag's user text onto its words), tags (the user's text in a column tag brings the column row: the pane one row lower); addons/{fake,life,pdf,snake}.out re-recorded (each kind's window one row taller); PROCESS: 27 waits on `Newcol Joincol` now `Newcol Help Exit`; Dump (dump, load, restore, headersweep-restored), Debug (topbarexec, windowops) and Tutor (tutor), which left the window row, typed into its own text after its words (B1 on Find, A, the word, Esc) and run there by B2; headersweep types after the window's words with A (a click at a column now inside them) and sweeps the second column's `New Term`; tagnav enters the column tag on its user's text (`b`, not `w`) and types Dump into the window's own text, its five B from `$` having run Themes in the old golden, not the Dump its comment says, now one B and Dump, and three B onto Restore; and every click on a row under the column row of a one-column session one row up (the window row's own clicks unchanged), each checked against its old golden's screen, the lower pane's rows staying where the extra row went above them (diffview's last look); GOLDENS: 101 re-recorded (ttyhelp left as it was: the change after this re-records it), every snap checked by a script against its old screen (each text row the same or one row up, the caret the same or one row up), every move one of: the window row's new words (the lone column's `New Term` at the left, the window's at the right end), the column row gone with one column (every row under it up one, one more text row at a foot), the column tags' words, Help's `topbar` annotations gone from the words that left, a header's caret on its user's text (emptycol, layout-close, tagnav), a nested session two rows (nested-optout), the typed Dump, Debug and Tutor in the window row; GATES: core-test 1130/1303 (173 skipped: +4, ssonuoyn 1126/1299), shell-test 1351/1354 (3 skipped: +1), pane-test 183/184 (1 skipped), behaviour-test 280/280 and --replay 20 seeds of 70 steps 0 failures, process-test 1 of 147 failed (ttyhelp: this change moves it too; the change after this re-records it; 3 skipped), term-test 17/17, kitty-test 45/45, the gui unit-test 1954/1958 (4 skipped, none failed; ssonuoyn 1949/1954; its one failed step the perf check's known BaselineHarnessMismatch); the two tagline.zig tests on the base (ssonuoyn, the tests alone): both fail, the header's at its first question (`Newcol Joincol Find Grep Help ...` where `Find Grep Newcol Help Exit ` is asked), the dump's at the window's old row restored as its own text (the layout and mouse tests ask for windowRow and columnInWindowRow, which the base has not); the dump fuzz at 40,000 join seeds twice and 1,779 image seeds 11/11 (no field changed; the header rows change the layout); the soak `replicas -- --clients 5 --rtt 30,80,207`: diverged 0, unequal 0, agree/differ 491/0 338/0 522/0, unlisted stops 0, the corpus 22 of 22 scenes the same, no leak; no frame/perf gate (the coordinator's, at the programme's end); load 2.0 to 14.8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'test/process/tty_editing.zig')
| -rw-r--r-- | test/process/tty_editing.zig | 203 |
1 files changed, 106 insertions, 97 deletions
diff --git a/test/process/tty_editing.zig b/test/process/tty_editing.zig index bdd84dc5..862897e7 100644 --- a/test/process/tty_editing.zig +++ b/test/process/tty_editing.zig @@ -300,12 +300,12 @@ fn yankpaste(gpa: std.mem.Allocator, exe: [:0]const u8) !void { defer t.deinit(); try t.lines("f.txt", 5, ""); try t.start(31, 100, &.{"f.txt"}); - try t.wait(8000, "Newcol Joincol"); + try t.wait(8000, "Newcol Help Exit"); try t.wait(8000, "line 5"); try t.stable(700, 20000); // linewise: x-select line 2, yank, move down, paste below line 3 - try t.press("left", "8", 5); - try t.release("left", "8", 5); + try t.press("left", "8", 4); + try t.release("left", "8", 4); try t.stable(400, 5000); try t.key("x y j p"); try t.stable(400, 5000); @@ -315,8 +315,8 @@ fn yankpaste(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("linewise-above"); // charwise: v-select two chars of line 1, yank, paste splices after them - try t.press("left", "8", 4); - try t.release("left", "8", 4); + try t.press("left", "8", 3); + try t.release("left", "8", 3); try t.stable(400, 5000); try t.key("v l y p"); try t.stable(400, 5000); @@ -637,8 +637,8 @@ fn find(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 15000); try t.snap("promoted"); // a second Find from here.txt reuses its query pane; nothing found is 0 - try t.press("left", "8", 4); - try t.release("left", "8", 4); + try t.press("left", "8", 3); + try t.release("left", "8", 3); try t.stable(400, 5000); try t.key("space"); try t.key("f"); @@ -653,9 +653,9 @@ fn find(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.snap("cancel"); // B2 on Find with `zqm` selected in here.txt: the query pane under it, the // keyboard still in here.txt - try t.press("left", "13", 4); - try t.drag("left", "15", 4); - try t.release("left", "15", 4); + try t.press("left", "13", 3); + try t.drag("left", "15", 3); + try t.release("left", "15", 3); try t.stable(400, 5000); try t.press("middle", "@Find", 1); try t.release("middle", "@Find", 1); @@ -1151,30 +1151,30 @@ fn lookrange(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.snap("opened"); // --- form 1: whole lines. r.txt opens BELOW look.txt (an ordinary look) with // lines 3, 4 and 5 selected whole, terminators included — helix's own `x`. - try t.press("right", "10", 4); - try t.release("right", "10", 4); + try t.press("right", "10", 3); + try t.release("right", "10", 3); try t.wait(10000, "cccc dccc"); try t.stable(700, 15000); try t.snap("wholelines"); try t.style("wholelines"); // --- form 2: one line, a column span. r.txt is open now, so this re-uses that // pane (focusPaneByPath) — the same route a `/` result row takes. - try t.press("right", "12", 5); - try t.release("right", "12", 5); + try t.press("right", "12", 4); + try t.release("right", "12", 4); try t.stable(700, 15000); try t.snap("onelinespan"); try t.style("onelinespan"); // --- form 3: the general one, across both lines and columns - try t.press("right", "12", 6); - try t.release("right", "12", 6); + try t.press("right", "12", 5); + try t.release("right", "12", 5); try t.stable(700, 15000); try t.snap("fullspan"); try t.style("fullspan"); // --- a STALE range: line 99 of a nine-line file, which is what a result row // looks like once the file has changed underneath it. It must CLAMP — no crash, // no garbage highlight — landing on the last cell that really exists. - try t.press("right", "12", 7); - try t.release("right", "12", 7); + try t.press("right", "12", 6); + try t.release("right", "12", 6); try t.stable(700, 15000); try t.snap("stale"); try t.style("stale"); @@ -1358,29 +1358,29 @@ fn cmdword(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // verbs are what is under test here, not the announcement. try t.config("Verbose off"); try t.start(31, 120, &.{"cmds.txt"}); - try t.wait(8000, "Newcol Joincol"); + try t.wait(8000, "Newcol Help Exit"); try t.wait(8000, "cmds.txt"); try t.stable(700, 20000); try t.snap("opened"); // a single middle CLICK inside the run (col 11 is inside `echo`) expands to the // whole `@`echo ZZ''E`` and runs it as a command pane; focus stays on the file - try t.press("middle", "11", 4); - try t.release("middle", "11", 4); + try t.press("middle", "11", 3); + try t.release("middle", "11", 3); try t.wait(10000, "ZZE"); try t.stable(700, 15000); try t.snap("atexec"); // LOOK on the second one (col 24, inside its `echo`) runs it too, in the same // command pane now its first is done, below it, AND focuses it — that is the // whole difference between the two verbs - try t.press("right", "24", 4); - try t.release("right", "24", 4); + try t.press("right", "24", 3); + try t.release("right", "24", 3); try t.wait(10000, "ZZL"); try t.stable(700, 15000); try t.snap("atlook"); // `Look p.txt` middle-dragged: the builtin by NAME, with an argument - try t.press("middle", "36", 4); - try t.drag("middle", "45", 4); - try t.release("middle", "45", 4); + try t.press("middle", "36", 3); + try t.drag("middle", "45", 3); + try t.release("middle", "45", 3); try t.wait(10000, "just text"); try t.stable(700, 15000); try t.snap("lookword"); @@ -1388,8 +1388,8 @@ fn cmdword(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // Look builtin with an argument, and Look opens the directory: a pane named // for it with a trailing /, listing it (zzmark.txt is only ever in that // listing: no pane here shows it otherwise), which takes the keyboard - try t.press("middle", "49", 4); - try t.release("middle", "49", 4); + try t.press("middle", "49", 3); + try t.release("middle", "49", 3); try t.wait(10000, "zzmark.txt"); try t.stable(700, 15000); try t.snap("nested"); @@ -1449,8 +1449,8 @@ fn lsp(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 20000); try t.snap("opened"); // park the cursor inside the CALL `helper(41)` (file line 8, grid row 9) - try t.press("left", "18", 11); - try t.release("left", "18", 11); + try t.press("left", "18", 10); + try t.release("left", "18", 10); try t.stable(400, 5000); try t.snap("cursor"); // gd on a call: exactly one location comes back, so it JUMPS rather than @@ -1482,8 +1482,8 @@ fn lsp(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.snap("step"); // gd on something with no declaration behind it (a keyword) answers nothing, // and nothing is a legal answer: no buffer opens, no error is rendered. - try t.press("left", "8", 6); - try t.release("left", "8", 6); + try t.press("left", "8", 5); + try t.release("left", "8", 5); try t.key("g"); try t.key("d"); try t.stable(700, 10000); @@ -1511,8 +1511,8 @@ fn lsp_client(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.wait(8000, "add(1, 2)"); try t.stable(700, 20000); // cursor into the first `add` call, then helix's goto-definition - try t.press("left", "13", 6); - try t.release("left", "13", 6); + try t.press("left", "13", 5); + try t.release("left", "13", 5); try t.key("g"); try t.key("d"); try t.wait(10000, "pub fn add"); @@ -1669,8 +1669,8 @@ fn lspcomplete(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.snap("opened"); // Tab with no dot before it is still Tab: line 10 is the closing `}`, and this // is the plain insert_tab path putting spaces in front of it. - try t.press("left", "8", 13); - try t.release("left", "8", 13); + try t.press("left", "8", 12); + try t.release("left", "8", 12); try t.key("i"); try t.key("tab"); try t.stable(400, 5000); @@ -1683,8 +1683,8 @@ fn lspcomplete(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // retroactively when the empty answer arrives (lspResponse), on the condition // that the cursor has not moved meanwhile. Four spaces go in after `// note.` // and the keystroke is not eaten, which is the whole contract. - try t.press("left", "16", 15); - try t.release("left", "16", 15); + try t.press("left", "16", 14); + try t.release("left", "16", 14); try t.stable(400, 5000); try t.key("i"); try t.key("tab"); @@ -1694,8 +1694,8 @@ fn lspcomplete(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.settle(100); // Line 8 (grid row 9, 1-based click row 10) is the switch's empty body. End // puts the cursor past its indent, and then the dot is typed. - try t.press("left", "8", 11); - try t.release("left", "8", 11); + try t.press("left", "8", 10); + try t.release("left", "8", 10); try t.stable(400, 5000); try t.key("i"); try t.key("end"); @@ -1744,8 +1744,8 @@ fn lspcomplete(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(41, 120, &.{"notes.txt"}); try t.wait(8000, "abc.def"); try t.stable(700, 20000); - try t.press("left", "12", 4); - try t.release("left", "12", 4); + try t.press("left", "12", 3); + try t.release("left", "12", 3); try t.key("i"); try t.key("tab"); try t.stable(400, 5000); @@ -1763,8 +1763,8 @@ fn lspcomplete(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(19, 100, &.{"c.zig"}); try t.wait(8000, "nosemi"); try t.stable(700, 20000); - try t.press("left", "8", 10); - try t.release("left", "8", 10); + try t.press("left", "8", 9); + try t.release("left", "8", 9); try t.stable(400, 5000); try t.key("i"); try t.key("end"); @@ -1784,8 +1784,8 @@ fn lspcomplete(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(19, 100, &.{"d.zig"}); try t.wait(8000, "nobrace"); try t.stable(700, 20000); - try t.press("left", "8", 11); - try t.release("left", "8", 11); + try t.press("left", "8", 10); + try t.release("left", "8", 10); try t.stable(400, 5000); try t.key("i"); try t.key("end"); @@ -1821,8 +1821,8 @@ fn lspcompletemoved(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(21, 120, &.{"a.zig"}); try t.wait(8000, "verdigris"); try t.stable(700, 20000); - try t.press("left", "16", 15); - try t.release("left", "16", 15); + try t.press("left", "16", 14); + try t.release("left", "16", 14); try t.stable(400, 5000); try t.key("i"); try t.key("tab"); @@ -1851,12 +1851,12 @@ fn lspdebug(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.snap("opened"); // Ctrl-click jumps to the definition; plain click only moves the cursor. - try t.press("ctrl-left", "22", 11); - try t.release("ctrl-left", "22", 11); + try t.press("ctrl-left", "22", 10); + try t.release("ctrl-left", "22", 10); try t.stable(700, 15000); try t.snap("ctrlclick"); - try t.press("left", "22", 11); - try t.release("left", "22", 11); + try t.press("left", "22", 10); + try t.release("left", "22", 10); try t.stable(700, 15000); try t.snap("plainclick"); @@ -1927,8 +1927,8 @@ fn lsprelpath(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(35, 100, &.{"sub/parent.zig"}); try t.wait(8000, "fn pick"); try t.stable(700, 20000); - try t.press("left", "31", 6); - try t.release("left", "31", 6); + try t.press("left", "31", 5); + try t.release("left", "31", 5); try t.stable(400, 5000); try t.key("g"); try t.key("r"); @@ -1950,8 +1950,8 @@ fn lsprelpath(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(35, 100, &.{"sub/subdir.zig"}); try t.wait(8000, "fn hue"); try t.stable(700, 20000); - try t.press("left", "29", 6); - try t.release("left", "29", 6); + try t.press("left", "29", 5); + try t.release("left", "29", 5); try t.stable(400, 5000); try t.key("g"); try t.key("r"); @@ -1965,8 +1965,8 @@ fn lsprelpath(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 15000); try t.snap("sublook"); try t.style("sublook"); - try t.press("right", "12", 13); - try t.release("right", "12", 13); + try t.press("right", "12", 12); + try t.release("right", "12", 12); try t.stable(700, 15000); try t.snap("clicked"); try t.done(); @@ -1983,8 +1983,8 @@ fn lsp_rename(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.wait(8000, "helper(41)"); try t.stable(700, 20000); // Put the cursor inside the top-level call, then use the helix rename binding. - try t.press("left", "18", 11); - try t.release("left", "18", 11); + try t.press("left", "18", 10); + try t.release("left", "18", 10); try t.key("space"); try t.key("l"); try t.key("r"); @@ -2023,14 +2023,14 @@ fn lsp_rename_files(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(25, 100, &.{"lib.rs"}); try t.wait(8000, "pub fn add"); try t.stable(700, 20000); - try t.press("right", "@main.rs", 4); - try t.release("right", "@main.rs", 4); + try t.press("right", "@main.rs", 3); + try t.release("right", "@main.rs", 3); try t.wait(8000, "let x = add"); try t.stable(700, 15000); try t.snap("opened"); // into lib.rs's `add`, and rename it from there - try t.press("left", "@add", 5); - try t.release("left", "@add", 5); + try t.press("left", "@add", 4); + try t.release("left", "@add", 4); try t.stable(400, 5000); try t.key("space"); try t.key("l"); @@ -2085,12 +2085,12 @@ fn diffview(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.file("src/shape.zig", "const std = @import(\"std\");\n\npub const Shape = union(enum) {\n circle: f32,\n square: f32,\n triangle: struct { base: f32, height: f32 },\n\n const note =\n \\\\areas, defer\n \\\\summed\n ;\n};\n"); try t.file("change.diff", "diff --git a/src/shape.zig b/src/shape.zig\nindex 1111111..2222222 100644\n--- a/src/shape.zig\n+++ b/src/shape.zig\n@@ -1,10 +1,12 @@\n const std = @import(\"std\");\n \n pub const Shape = union(enum) {\n circle: f32,\n- square: u8 = 7,\n+ square: f32,\n+ triangle: struct { base: f32, height: f32 },\n \n const note =\n- \\\\areas\n+ \\\\areas, defer\n+ \\\\summed\n ;\n };\n"); try t.start(31, 100, &.{"change.diff"}); - try t.wait(8000, "Newcol Joincol"); + try t.wait(8000, "Newcol Help Exit"); try t.stable(700, 20000); try t.snap("diff-pane"); try t.style("diff-colours"); - try t.press("right", "8", 15); - try t.release("right", "8", 15); + try t.press("right", "8", 14); + try t.release("right", "8", 14); try t.stable(700, 15000); try t.snap("look-added-line"); // The same diff printed by a command (`git diff`, here `cat`) into a command @@ -2100,9 +2100,9 @@ fn diffview(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(31, 100, &.{"cmds.txt"}); try t.wait(8000, "cmds.txt"); try t.stable(700, 20000); - try t.press("middle", "7", 4); - try t.drag("middle", "22", 4); - try t.release("middle", "22", 4); + try t.press("middle", "7", 3); + try t.drag("middle", "22", 3); + try t.release("middle", "22", 3); try t.wait(10000, "exit 0"); try t.stable(700, 15000); try t.snap("command-pane"); @@ -2156,14 +2156,14 @@ fn dirpane(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(24, 80, &.{"top.txt"}); try t.wait(8000, "top.txt"); try t.stable(700, 20000); - try t.press("right", "@sub", 4); - try t.release("right", "@sub", 4); + try t.press("right", "@sub", 3); + try t.release("right", "@sub", 3); try t.wait(8000, "inner.txt"); try t.stable(700, 20000); try t.snap("dir-open"); // an entry, by its name alone: sub's inner.txt - try t.press("right", "@inner.txt", 7); - try t.release("right", "@inner.txt", 7); + try t.press("right", "@inner.txt", 6); + try t.release("right", "@inner.txt", 6); try t.wait(8000, "inner-marker"); try t.stable(700, 20000); try t.snap("entry-open"); @@ -2183,12 +2183,12 @@ fn scrolloff(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 20000); // right-click the g.txt name in the greeting ls -> file pane under the shell's // text, 9 body rows - try t.press("right", "4", 5); - try t.release("right", "4", 5); + try t.press("right", "4", 4); + try t.release("right", "4", 4); try t.wait(10000, "line 3"); try t.stable(700, 15000); - try t.press("left", "10", 9); - try t.release("left", "10", 9); + try t.press("left", "10", 8); + try t.release("left", "10", 8); try t.stable(400, 5000); // (b) gg: cursor CAN sit on the top body row, no forced scroll try t.key("g g"); @@ -2245,7 +2245,7 @@ fn wrap(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // 48 columns: the 2-column chrome gutter, the 5-column line-number gutter and // the 1 column the `↩` sits in leave 40 for content. try t.start(15, 48, &.{"long.txt"}); - try t.wait(8000, "Newcol Joincol"); + try t.wait(8000, "Newcol Help Exit"); try t.stable(700, 20000); // the default: five rows for line 1 (200 bytes / 40), the four continuations // gutterless and starting at `4` `8` `C` `G` — the columns 40, 80, 120, 160 — @@ -2301,7 +2301,7 @@ fn wrap(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // 128 columns: 120 for content, and the break is at the `C` — column 120, the // window's own width. The old 100-column cap would have broken at the `A`. try t.start(15, 128, &.{"long.txt"}); - try t.wait(8000, "Newcol Joincol"); + try t.wait(8000, "Newcol Help Exit"); try t.stable(700, 20000); try t.snap("on-wide"); try t.done(); @@ -2403,7 +2403,7 @@ fn tagcmd(gpa: std.mem.Allocator, exe: [:0]const u8) !void { defer t.deinit(); try t.lines("c.txt", 6, ""); try t.start(31, 100, &.{"c.txt"}); - try t.wait(8000, "Newcol Joincol"); + try t.wait(8000, "Newcol Help Exit"); try t.wait(8000, "c.txt"); try t.stable(700, 20000); // edit line 1 so Save has something to write @@ -2458,7 +2458,7 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.config("Jumps new-pane"); try t.file("w.txt", "alpha\nbeta\ngamma"); try t.start(31, 100, &.{"w.txt"}); - try t.wait(8000, "Newcol Joincol"); + try t.wait(8000, "Newcol Help Exit"); try t.wait(8000, "w.txt"); try t.stable(700, 20000); // A FILE boots alone, so the launch shell is opened here: Alt-n opens it and @@ -2533,21 +2533,29 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-w k"); try t.stable(400, 5000); try t.snap("column-tag"); - try t.key("w"); + // On its own text, after its computed words (UX K'1): b moves back onto + // them as in a body. + try t.key("b"); try t.stable(400, 5000); try t.snap("column-word"); try t.key("c-w k"); try t.stable(400, 5000); try t.snap("workspace-tag"); - // `$` is the last cell; five long-word steps back land on `Dump`, and the - // execute key runs it and gives the keyboard back to the body FIRST -- `Exit` - // lives up here too, so a builtin that frees the session must never return - // into a focused header. Dump grows a `Restore <path>` word, which is also the - // case where the line gets longer than the column you were parked on. + // Dump left the window's words (UX K'4): typed into its own text, where + // the keyboard starts (K'1), a word like any other. `$` is the last cell; + // a long-word step back lands on `Dump`, and the execute key runs it and + // gives the keyboard back to the body FIRST -- `Exit` lives up here too, + // so a builtin that frees the session must never return into a focused + // header. Dump grows a `Restore <path>` word, which is also the case where + // the line gets longer than the column you were parked on. + try t.key("i"); + try t.send("Dump"); + try t.key("esc"); + try t.settle(100); try t.key("g l"); try t.stable(400, 5000); try t.snap("topbar-dollar"); - try t.key("B B B B B"); + try t.key("B"); try t.stable(400, 5000); try t.snap("topbar-dump-word"); try t.key("tab"); @@ -2555,12 +2563,13 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.snap("topbar-exec"); // THE DELETION HAZARD, from the bar itself: `Restore` frees every pane and // swaps the core out from under the caller. Walk back up onto the word the - // Dump just grew -- B twice off the tail, because the LONG word motions are the - // ones that step over a path in one go -- and run it. + // Dump just grew -- B three times off the tail (`Dump`, the path, `Restore`), + // because the LONG word motions are the ones that step over a path in one + // go -- and run it. try t.key("c-w k"); try t.key("c-w k"); try t.stable(400, 5000); - try t.key("g l B B"); + try t.key("g l B B B"); try t.stable(400, 5000); try t.snap("topbar-restore-word"); try t.key("tab"); @@ -2578,7 +2587,7 @@ fn tagpath(gpa: std.mem.Allocator, exe: [:0]const u8) !void { defer t.deinit(); try t.lines("c.txt", 4, ""); try t.start(31, 100, &.{"c.txt"}); - try t.wait(8000, "Newcol Joincol"); + try t.wait(8000, "Newcol Help Exit"); try t.wait(8000, "c.txt"); try t.stable(700, 20000); try t.snap("start"); @@ -2599,10 +2608,10 @@ fn tagpath(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("yanked-path"); // Sweep across the path / command boundary without injected padding. - try t.press("left", "12", 3); - try t.drag("left", "30", 3); - try t.drag("left", "42", 3); - try t.release("left", "42", 3); + try t.press("left", "12", 2); + try t.drag("left", "30", 2); + try t.drag("left", "42", 2); + try t.release("left", "42", 2); try t.stable(400, 5000); try t.snap("drag-cross"); try t.style("drag-cross"); |
