diff options
Diffstat (limited to 'test/process/tty_editing.zig')
| -rw-r--r-- | test/process/tty_editing.zig | 196 |
1 files changed, 100 insertions, 96 deletions
diff --git a/test/process/tty_editing.zig b/test/process/tty_editing.zig index a5d58906..bdd84dc5 100644 --- a/test/process/tty_editing.zig +++ b/test/process/tty_editing.zig @@ -392,42 +392,42 @@ fn chordcut(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 15000); try t.snap("opened"); // 1-2 Cut: left-drag over "line" on line 2, tap middle while holding - try t.press("left", "8", 10); - try t.drag("left", "11", 10); - try t.press("middle", "11", 10); - try t.release("middle", "11", 10); - try t.release("left", "11", 10); + try t.press("left", "8", 8); + try t.drag("left", "11", 8); + try t.press("middle", "11", 8); + try t.release("middle", "11", 8); + try t.release("left", "11", 8); try t.stable(400, 5000); try t.snap("cut"); // 1-2 then 1-3 in one hold = copy: line 3 keeps its text, register loaded - try t.press("left", "8", 11); - try t.drag("left", "11", 11); - try t.press("middle", "11", 11); - try t.release("middle", "11", 11); - try t.press("right", "11", 11); - try t.release("right", "11", 11); - try t.release("left", "11", 11); + try t.press("left", "8", 9); + try t.drag("left", "11", 9); + try t.press("middle", "11", 9); + try t.release("middle", "11", 9); + try t.press("right", "11", 9); + try t.release("right", "11", 9); + try t.release("left", "11", 9); try t.stable(400, 5000); try t.snap("copied"); // 1-3 at a bare click point: hold left past the end of line 4, tap right — // the register splices in at the click - try t.press("left", "14", 12); - try t.press("right", "14", 12); - try t.release("right", "14", 12); - try t.release("left", "14", 12); + try t.press("left", "14", 10); + try t.press("right", "14", 10); + try t.release("right", "14", 10); + try t.release("left", "14", 10); try t.stable(400, 5000); try t.snap("pointpaste"); // 1-3 over a fresh selection replaces it with the register - try t.press("left", "9", 13); - try t.drag("left", "11", 13); - try t.press("right", "11", 13); - try t.release("right", "11", 13); - try t.release("left", "11", 13); + try t.press("left", "9", 11); + try t.drag("left", "11", 11); + try t.press("right", "11", 11); + try t.release("right", "11", 11); + try t.release("left", "11", 11); try t.stable(400, 5000); try t.snap("replaced"); // arm the cancel tests: append `echo B''OO g.txt` to line 2 - try t.press("left", "10", 10); - try t.release("left", "10", 10); + try t.press("left", "10", 8); + try t.release("left", "10", 8); try t.stable(400, 5000); try t.key("i"); try t.send("echo B''OO g.txt"); @@ -436,56 +436,56 @@ fn chordcut(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); // 2-3 cancel (acme textselect2): tap right during the middle execute-drag // over `echo B''OO` — the command never runs (no BOO anywhere) - try t.press("middle", "10", 10); - try t.drag("middle", "19", 10); - try t.press("right", "19", 10); - try t.release("right", "19", 10); - try t.release("middle", "19", 10); + try t.press("middle", "10", 8); + try t.drag("middle", "19", 8); + try t.press("right", "19", 8); + try t.release("right", "19", 8); + try t.release("middle", "19", 8); try t.stable(700, 8000); try t.snap("cancelexec"); // the same drag released clean proves the word was live: BOO appears - try t.press("middle", "10", 10); - try t.drag("middle", "19", 10); - try t.release("middle", "19", 10); + try t.press("middle", "10", 8); + try t.drag("middle", "19", 8); + try t.release("middle", "19", 8); try t.wait(10000, "BOO"); try t.stable(700, 10000); try t.snap("execafter"); // 3-1 cancel (acme textselect3): tap left during the right look-drag over // g.txt — no pane opens - try t.press("right", "21", 10); - try t.drag("right", "25", 10); - try t.press("left", "25", 10); - try t.release("left", "25", 10); - try t.release("right", "25", 10); + try t.press("right", "21", 8); + try t.drag("right", "25", 8); + try t.press("left", "25", 8); + try t.release("left", "25", 8); + try t.release("right", "25", 8); try t.stable(700, 8000); try t.snap("cancellook"); // the same look released clean opens g.txt - try t.press("right", "21", 10); - try t.drag("right", "25", 10); - try t.release("right", "25", 10); + try t.press("right", "21", 8); + try t.drag("right", "25", 8); + try t.release("right", "25", 8); try t.wait(10000, "line 2"); try t.stable(700, 10000); try t.snap("lookafter"); // a fresh left click dismisses the chord's leftover selection instead of // dragging the anchored span to the click: copy `line` on g.txt line 1 // (styled snap shows the selection), then click the next row (it's gone) - try t.press("left", "8", 24); - try t.drag("left", "11", 24); - try t.press("middle", "11", 24); - try t.release("middle", "11", 24); - try t.press("right", "11", 24); - try t.release("right", "11", 24); - try t.release("left", "11", 24); + try t.press("left", "8", 23); + try t.drag("left", "11", 23); + try t.press("middle", "11", 23); + try t.release("middle", "11", 23); + try t.press("right", "11", 23); + try t.release("right", "11", 23); + try t.release("left", "11", 23); try t.stable(400, 5000); try t.style("chordsel"); - try t.press("left", "8", 25); - try t.release("left", "8", 25); + try t.press("left", "8", 24); + try t.release("left", "8", 24); try t.stable(400, 5000); try t.style("clickdismiss"); // g.txt opened under the lower shell's text and left it three rows: close it, // and the shell grows back into its rows, for what follows to run in - try t.press("middle", "59", 23); - try t.release("middle", "59", 23); + try t.press("middle", "@Del", 22); + try t.release("middle", "@Del", 22); try t.stable(700, 15000); // tty paste chord: over a mouse-listening app B1 is the app's, so the // chord's B1 holds Shift (B3 is pardes's either way); the app gets a click @@ -554,31 +554,31 @@ fn selarg(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(600, 8000); // keep a left selection over ZZARG in pane A (this also focuses A) - try t.press("left", "3", 5); - try t.drag("left", "7", 5); - try t.release("left", "7", 5); + try t.press("left", "3", 4); + try t.drag("left", "7", 4); + try t.release("left", "7", 4); try t.stable(400, 5000); try t.snap("kept"); // chord in pane B: middle on ./c.sh + left tap (B has NO selection: the // argument comes from pane A's kept left selection) + middle release runs - try t.press("middle", "55", 5); - try t.press("left", "55", 5); - try t.release("middle", "55", 5); - try t.release("left", "55", 5); + try t.press("middle", "55", 4); + try t.press("left", "55", 4); + try t.release("middle", "55", 4); + try t.release("left", "55", 4); try t.wait(10000, "CHORDARG:ZZARG"); try t.stable(700, 10000); try t.snap("crosspane"); // now an explicit modal selection: plain-click ZZVEE in A (drops A's kept // left selection), select it with v e, chord in B again - try t.press("left", "9", 5); - try t.release("left", "9", 5); + try t.press("left", "9", 4); + try t.release("left", "9", 4); try t.stable(400, 5000); try t.send("ve"); try t.stable(400, 5000); - try t.press("middle", "55", 5); - try t.press("left", "55", 5); - try t.release("middle", "55", 5); - try t.release("left", "55", 5); + try t.press("middle", "55", 4); + try t.press("left", "55", 4); + try t.release("middle", "55", 4); + try t.release("left", "55", 4); try t.wait(10000, "CHORDARG:ZZVEE"); try t.stable(700, 10000); try t.snap("vselarg"); @@ -1061,14 +1061,14 @@ fn lookpanes(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); // an ordinary dir look on the shell's own ls output: alpha's directory pane, // split below it, which takes the keyboard - try t.press("right", "@alpha", 6); - try t.release("right", "@alpha", 6); + try t.press("right", "@alpha", 5); + try t.release("right", "@alpha", 5); try t.wait(10000, "amark.txt"); try t.stable(700, 20000); // type the words to look into what is left of the workdir shell (past its own // ls output, on the same row: its last row is the resize handle) - try t.press("left", "95", 5); - try t.release("left", "95", 5); + try t.press("left", "95", 4); + try t.release("left", "95", 4); try t.stable(400, 5000); try t.key("i"); try t.send("zqonly.txt pick.txt twin.txt"); @@ -1077,42 +1077,42 @@ fn lookpanes(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(400, 5000); try t.snap("shells"); // make the beta pane the most recently focused, so the walk has to pass it - try t.press("left", "10", 5); - try t.release("left", "10", 5); + try t.press("left", "10", 4); + try t.release("left", "10", 4); try t.stable(700, 10000); // zqonly.txt is only under alpha: the clicked shell's cwd fails, beta fails, // alpha's directory pane answers. Before, this word became a search. - try t.press("right", "@zqonly.txt", 5); - try t.release("right", "@zqonly.txt", 5); + try t.press("right", "@zqonly.txt", 4); + try t.release("right", "@zqonly.txt", 4); try t.wait(10000, "ONLY-IN-ALPHA"); try t.stable(700, 20000); try t.snap("other-dir"); // both.txt is in BOTH dirs and alpha is now the most recent (its file pane // just opened), but the CLICK still wins: looked inside the beta pane it // opens beta's copy - try t.press("right", "10", 5); - try t.release("right", "10", 5); + try t.press("right", "10", 4); + try t.release("right", "10", 4); try t.wait(10000, "BOTH-FROM-BETA"); try t.stable(700, 20000); try t.snap("clicked-wins"); // from a pane whose own dir holds neither copy the access order decides: // focus alpha's directory pane (a click on its first row), look pick.txt (in // both dirs) from the workdir shell -> alpha's - try t.press("left", "@amark.txt", 9); - try t.release("left", "@amark.txt", 9); + try t.press("left", "@amark.txt", 8); + try t.release("left", "@amark.txt", 8); try t.stable(700, 10000); - try t.press("right", "@pick.txt", 5); - try t.release("right", "@pick.txt", 5); + try t.press("right", "@pick.txt", 4); + try t.release("right", "@pick.txt", 4); try t.wait(10000, "PICK-FROM-ALPHA"); try t.stable(700, 20000); try t.snap("mru-alpha"); // focus the beta pane instead and the same look flips: twin.txt is in both // dirs, beta is most recent, beta's copy opens - try t.press("left", "10", 5); - try t.release("left", "10", 5); + try t.press("left", "10", 4); + try t.release("left", "10", 4); try t.stable(700, 10000); - try t.press("right", "@twin.txt", 5); - try t.release("right", "@twin.txt", 5); + try t.press("right", "@twin.txt", 4); + try t.release("right", "@twin.txt", 4); try t.wait(10000, "TWIN-FROM-BETA"); try t.stable(700, 20000); try t.snap("mru-beta"); @@ -2390,8 +2390,10 @@ fn follow(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // `:` — vim's command line with acme's vocabulary. It focuses the pane's OWN // tag in NORMAL mode (block cursor; the layout box shows the pane's BODY mode, // which for this file pane is normal either way). The tag remembers where its -// cursor was; the first time there is nothing to remember and it starts on -// Save. The tag's normal mode is the body's: w selects the "Save" span exactly +// cursor was; the first time there is nothing to remember and it starts at +// the start of the tag's own text, after the computed words (`Save Undo Del` +// on this edited file). The tag's normal mode is the body's: b steps back +// over the words onto Save, w selects the "Save" span exactly // as a body word motion does, and the execute key runs the word under the // cursor and hands the body back — same keys as the body, so Tab by default // (see config.look_key/exec_key). `:` again backs out instead, leaving the tag @@ -2411,10 +2413,12 @@ fn tagcmd(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.settle(100); try t.stable(400, 5000); try t.snap("edited"); - // `:` -> the tag, in normal mode, cursor on Save + // `:` -> the tag, in normal mode, cursor at its own text try t.key(": :"); try t.stable(400, 5000); try t.snap("colon"); + // b three times: back over Del and Undo onto Save; `;` keeps the cursor alone + try t.key("b b b ;"); // w -> the "Save" span (selected, like the body's word motion) try t.key("w"); try t.stable(400, 5000); @@ -2439,7 +2443,7 @@ fn tagcmd(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // there are no tag-only hops. `:` is the one key a tag and a body do not // share: from the body it focuses the pane's own tag, from the tag it hands the // keyboard back to the body. Each tag remembers its cursor; the first time -// there is nothing to remember and it starts on Save. +// there is nothing to remember and it starts at the start of the tag's own text. // // Evidence is the `cursor=` header (the ACTIVE pane's cursor, which while a tag // is focused sits on THAT pane's tag row) plus each pane's layout box, which @@ -2472,12 +2476,13 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("space w k enter"); try t.stable(400, 5000); try t.snap("start"); - // `:` -> the file's OWN tagline, normal mode, on Save + // `:` -> the file's OWN tagline, normal mode, at its own text try t.key(": :"); try t.stable(400, 5000); try t.snap("colon"); - // w selects in the tag the way it selects in a body - try t.key("w"); + // w selects in the tag the way it selects in a body: from the tag's start + // (`0`; the cursor starts after the computed words, here the tag's end) + try t.key("0 w"); try t.stable(400, 5000); try t.snap("word"); // l is a motion in the tag, not a hop to the next pane @@ -2489,7 +2494,7 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-w l enter"); try t.stable(400, 5000); try t.snap("right"); - // `:` there -> that pane's own tag, on its Save the first time + // `:` there -> that pane's own tag, at its own text the first time try t.key(": :"); try t.stable(400, 5000); try t.snap("right-tag"); @@ -2511,8 +2516,8 @@ fn tagnav(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("c-b"); try t.stable(700, 15000); try t.snap("tty-on"); - try t.press("left", "@Mode", 3); - try t.release("left", "@Mode", 3); + try t.press("left", "@Term+bash", 3); + try t.release("left", "@Term+bash", 3); try t.stable(400, 5000); try t.snap("tty-tag"); try t.key(":"); @@ -2638,13 +2643,12 @@ fn tag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(31, 150, &.{ "-n", "3" }); try t.wait(8000, "t.txt"); try t.stable(700, 20000); - // Click the one editable separator before Save, directly after the cwd. - // The former generated alignment gap no longer exists. - // The layout box shows + // Click just past the end of the tag's own text (Term+bash, after the + // computed words). The layout box shows // the pane's BODY mode, not the tag's; `i` then types into the tag where it // was clicked. - try t.press("left", "@Save-1", 3); - try t.release("left", "@Save-1", 3); + try t.press("left", "@Term+bash+9", 3); + try t.release("left", "@Term+bash+9", 3); try t.stable(400, 5000); try t.snap("tag-focus"); try t.key("i"); |
