From 2367ed34beccf3f2f1b8bbf6b8a171f50933d7a1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 00:08:16 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Dir.zig | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'src/Dir.zig') diff --git a/src/Dir.zig b/src/Dir.zig index ebe6b69c..f43c6e02 100644 --- a/src/Dir.zig +++ b/src/Dir.zig @@ -179,8 +179,8 @@ pub fn refresh(p: *Pardes, id: usize) !void { panes.Output.resetBody(p, now); } -/// A look at directory `dir` (look.zig's `.dir`, with `DirLook pane`): its -/// pane, read again, or a new one, placed as a document is. +/// A look at directory `dir` (look.zig's `.dir`): its pane, read again, or +/// a new one, placed as a document is. pub fn look(p: *Pardes, from: usize, dir: []const u8) void { const name = (if (std.mem.endsWith(u8, dir, "/")) p.gpa.dupe(u8, dir) @@ -433,27 +433,6 @@ test "an exec in a directory pane runs in its directory, and its +Errors goes th try testing.expect(named(p, try std.fmt.bufPrint(&errors_buf, "{s}{s}", .{ sub_name, config.errors_buffer })).id != null); } -test "DirLook terminal: a look at a directory opens a terminal there, no pane listing it" { - if (comptime !pardes.hosted) return; - var tmp = testing.tmpDir(.{}); - defer tmp.cleanup(); - var buf: [4096]u8 = undefined; - const s = try session(&tmp, &buf); - defer s.p.deinit(); - const p = s.p; - try testing.expect(p.executeBuiltinLine(0, "DirLook terminal")); - try testing.expectEqual(config.Runtime.DirLook.terminal, p.settings.dir_look); - pardes.look.lookAt(p, 0, s.dir); - p.sync(); - var name_buf: [4200]u8 = undefined; - try testing.expectEqual(@as(usize, 0), named(p, try std.fmt.bufPrint(&name_buf, "{s}/", .{s.dir})).count); - try testing.expect(p.panes[p.active].?.isTerminal()); - try testing.expectEqualStrings(s.dir, p.panes[p.active].?.cwdSlice()); - // Bare, it steps back to pane, the default. - try testing.expect(p.executeBuiltinLine(0, "DirLook")); - try testing.expectEqual(config.Runtime.DirLook.pane, p.settings.dir_look); -} - test "over 9P a directory pane is a text pane whose name ends in /, its body the listing, ctl's isdir 1, and get reads it again" { if (comptime !pardes.hosted) return; const th = @import("ninep/testing.zig"); -- cgit v1.3