diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 16:15:15 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 06fe2290db7d0eb654b9a908358942cfde298e29 (patch) | |
| tree | 3951919743798ec978e7ae925529c4fbd4ea130a /test | |
| parent | 07a3f53993a27c886ccb3ed665acb9c8b34a2873 (diff) | |
| download | pardes-06fe2290db7d0eb654b9a908358942cfde298e29.tar.gz pardes-06fe2290db7d0eb654b9a908358942cfde298e29.zip | |
$ keeps the selections a shell command exits 0 on, and line end is gl
$ was a second key for line end, which helix never meant: in helix it is
shell_keep_pipe. It now arms the pipe prompt with a $ marker, runs the
command once per range with that range's text on stdin, and keeps the ranges
it exits 0 on; the primary stays if kept, else the last kept range takes
over, and keeping none changes nothing. The runner's answer is all or
nothing, so the command runs in a subshell whose status is echoed as its
output. Line end stays on helix's own gl and End; the snapshots, tutor and
docs that pressed $ for it press gl.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/panes.zig | 6 | ||||
| -rw-r--r-- | test/pdf.zig | 3 | ||||
| -rw-r--r-- | test/snapshots/badutf.snap | 2 | ||||
| -rw-r--r-- | test/snapshots/hscroll.snap | 4 | ||||
| -rw-r--r-- | test/snapshots/tagnav.snap | 4 |
5 files changed, 12 insertions, 7 deletions
diff --git a/test/panes.zig b/test/panes.zig index 0b9909ad..f0e1ba3d 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -1954,7 +1954,11 @@ test "a prompt owns the pipe behavior through cancellation and submission" { p.update(.{ .key = .{ .cp = Key.enter } }); const pending = p.pipe.wait orelse return error.MissingPipe; try std.testing.expectEqual(how, pending.how); - try std.testing.expectEqualStrings("cat", pending.command); + // `$` runs the command in a subshell that reports its status + if (how == .keep) + try std.testing.expect(std.mem.indexOf(u8, pending.command, "\ncat\n") != null) + else + try std.testing.expectEqualStrings("cat", pending.command); try std.testing.expectEqual(@as(usize, 1), pending.inputs.len); try std.testing.expectEqualStrings(if (how.pipes()) "one" else "", pending.inputs[0].bytes); try std.testing.expect(pane.prompt == .none); diff --git a/test/pdf.zig b/test/pdf.zig index 3a592451..8b94c1ae 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -859,7 +859,8 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" { p.update(.{ .key = .{ .cp = '2' } }); p.update(.{ .key = .{ .cp = 'l' } }); try std.testing.expect(pane.pdf.?.pan_x > 0); - p.update(.{ .key = .{ .cp = '$' } }); + p.update(.{ .key = .{ .cp = 'g' } }); + p.update(.{ .key = .{ .cp = 'l' } }); try std.testing.expectEqual(std.math.maxInt(u16), pane.pdf.?.pan_x); p.update(.{ .key = .{ .cp = '2' } }); p.update(.{ .key = .{ .cp = 'h' } }); diff --git a/test/snapshots/badutf.snap b/test/snapshots/badutf.snap index ddd1588b..7171df00 100644 --- a/test/snapshots/badutf.snap +++ b/test/snapshots/badutf.snap @@ -19,6 +19,6 @@ stable 700 20000 # first visible CJK glyph intact instead of starting inside its UTF-8 bytes. key space t w stable 400 5000 -key $ +key g l stable 700 10000 snap hscroll-midglyph diff --git a/test/snapshots/hscroll.snap b/test/snapshots/hscroll.snap index 6f73154f..05366323 100644 --- a/test/snapshots/hscroll.snap +++ b/test/snapshots/hscroll.snap @@ -36,10 +36,10 @@ send \x1b[<67;10;8M send \x1b[<67;10;8M stable 400 5000 snap clamped -# $ walks the cursor to the line end: the view follows with the margin +# gl walks the cursor to the line end: the view follows with the margin key g g stable 400 5000 -key $ +key g l stable 400 5000 snap dollar # 0 back to column zero: the view snaps home diff --git a/test/snapshots/tagnav.snap b/test/snapshots/tagnav.snap index 95c4b751..f145480e 100644 --- a/test/snapshots/tagnav.snap +++ b/test/snapshots/tagnav.snap @@ -98,7 +98,7 @@ snap workspace-tag # 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. -key $ +key g l stable 400 5000 snap topbar-dollar key B B B B @@ -114,7 +114,7 @@ snap topbar-exec key c-w k key c-w k stable 400 5000 -key $ B B +key g l B B stable 400 5000 snap topbar-restore-word key tab |
