diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 00:08:16 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 00:32:56 -0300 |
| commit | 2367ed34beccf3f2f1b8bbf6b8a171f50933d7a1 (patch) | |
| tree | 8dcc7111d1e78806c6ac0e0bd1493c25d86bfc85 /src/ninep/ctl.zig | |
| parent | 43a4c24e607a456d7a23eb8a779bce5651f18222 (diff) | |
| download | pardes-2367ed34beccf3f2f1b8bbf6b8a171f50933d7a1.tar.gz pardes-2367ed34beccf3f2f1b8bbf6b8a171f50933d7a1.zip | |
config, exec, look: Placement, BootShell, LookWord, DirLook and DiffLook go, with what each kept of pardes before it took acme's ways (exec's pardesPlace, atFoot, belowParent, pardesDoc and evictLonePristineTty with mouse.zig's call, layout's splitParent and columnFitsHalves that only they called, look's ls in a terminal for a directory, the word and patch looks' other branches, the SPC c p key, their Help and builtins-JSON rows, their lines in docs/typ and a changelog line), and the tests of them: Dir.zig's "DirLook terminal: a look at a directory opens a terminal there, no pane listing it", pardes.zig's "first document fallback splits like Term from the originating pane", "first document keeps its originating shell and only opens a column when it fits", "BootShell keep leaves the untouched boot shell a dragged document joins; replace closes it" and "a Look on a directory does not type ls into an occupied terminal", keys.zig's "keys: SPC j n and SPC j p walk on from the place a Look's +Search listing chose, its keyboard left in the file", look_and_exec.zig's "look-and-exec: a second LookWord list look in a directory refills its +Search rather than stacking another", placement.zig's "placement: Placement pardes puts a new pane right under the asking one, and bare it steps back to acme", output.zig's "LookNext/LookPrev keeps the result output a Look chose through a no-match answer, and a stale serial once it is deleted", and the snapshot scripts that turned them on (cmdword, doccol, look-dir, lookpanes, rsearch, splitparent, ttylook); the Del question's test makes its middle panes the acme way, a New at the column's foot, and the others that turned one on for their layout run without it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index cb4cfa97..2a2131e3 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -91,7 +91,7 @@ pub fn run(p: *Pardes, id: usize, exec: bool, text: []const u8, in_tag: bool) vo for (after.list[0..after.len]) |serial| if (std.mem.indexOfScalar(u32, before.list[0..before.len], serial) == null) { // A query pane's +Preview is its query pane's: that answers. if (p.paneBySerial(serial)) |made| if (p.panes[made].?.file) |f| if (f.output) |o| if (o.from == .preview) continue; - // A look that made a +Search pane (LookWord list, a terminal) + // A look that made a +Search pane (a terminal's word) // answers it: that is where the places it found are. noteResult(p, serial); created = true; @@ -732,9 +732,9 @@ pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfM f.pager_spans = page.spans; f.saved_revision = f.revision; // A diff paged (`git show`, difftui's patches): its hunks stacked in a - // +Diff (DiffLook hunks) in the +Pager's place, the +Pager closed. The - // keyboard stays where it was, as a page's. - if (f.pager_diff and p.settings.diff_look == .hunks) { + // +Diff in the +Pager's place, the +Pager closed. The keyboard stays + // where it was, as a page's. + if (f.pager_diff) { const keyboard = p.active; if (panes.Output.openDiff(p, id, f.path, f.content)) |hid| { // ponytail: the text is gone with it; Diff on the +Diff says no such file. @@ -954,7 +954,7 @@ pub fn writeFocus(p: *Pardes, req: Req) Reply { const id = p.paneBySerial(serial) orelse return tree.failText(req.tag, E.NOENT, e_no_pane); // The keyboard goes to the pane itself, off any header that had it, and // its column becomes the active one, as the user's click there would - // make it: pane/new and a look place there next, whatever Placement. + // make it: pane/new and a look place there next. tagline.exitHeader(p); p.active = id; if (pardes.layout.findPane(p, id)) |at| p.setActiveColumn(at.col); @@ -1429,7 +1429,7 @@ test "commands lists every builtin with its argument and the ctl that takes it" var here: usize = 0; for (std.enums.values(Builtin)) |b| here += @intFromBool(builtins.registry.here(p, b)); try testing.expectEqual(here, lines); - for ([_][]const u8{ "\nDel arg pane -- ", "\nNewcol root -- ", "\nSave arg pane", "\nVerbose arg root on,off", "\nPlacement arg root acme,pardes", "\nUndo pane -- ", "\nEdit arg both -- acme's Edit" }) |row| + for ([_][]const u8{ "\nDel arg pane -- ", "\nNewcol root -- ", "\nSave arg pane", "\nVerbose arg root on,off", "\nUndo pane -- ", "\nEdit arg both -- acme's Edit" }) |row| try testing.expect(std.mem.indexOf(u8, listed.bytes, row) != null); } @@ -2052,10 +2052,9 @@ test "a terminal told the directory it already goes by logs no rename" { try testing.expect(th.logHas(p, try std.fmt.bufPrint(&rec, "rename {d} /usr", .{p.panes[term].?.serial}))); } -test "a terminal with text typed at its prompt is never typed into: a look at its directory opens another" { +test "a terminal with text typed at its prompt is never typed into: a look at its directory or an exec at it opens a pane of its own" { const p = try th.withTerm(testing.allocator); defer p.deinit(); - p.settings.dir_look = .terminal; // `ls` in a terminal, not a directory pane const term = p.paneBySerial(serialOf(p)).?; p.setCwd(term, "/tmp"); p.update(.{ .output = .{ .pane = @intCast(term), .bytes = "\x1b]133;A;aid=pardes\x07$ \x1b]133;B;aid=pardes\x07TYPED" } }); @@ -2598,7 +2597,6 @@ test "every word's /commands description is its own doc comment's first sentence "\nNewcol root -- An empty column right of the keyboard's, its tag taking the keyboard.\n", "\nSave arg pane -- Write the pane's text to its file, or to the file its argument names.\n", "\nVerbose arg root on,off -- A builtin says its own name on the message row as it runs, on or off.\n", - "\nPlacement arg root acme,pardes -- Where a new pane goes: acme, as makenewwindow does, or pardes, the older rules.\n", "\nKill arg root -- acme's Kill: stop the commands pardes started", }) |row| try testing.expect(std.mem.indexOf(u8, listed, row) != null); try testing.expect(std.mem.indexOf(u8, listed, ".c:") == null); |
