summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 17:36:52 -0300
committerGabriel Schneider <[email protected]>2026-10-01 17:47:47 -0300
commit2dbb047a82523c578cb511058c6e1b745cfc8073 (patch)
tree4e03e5e59399a233f7f50f21dd883c707db57f40 /src/look.zig
parent322aff16a2ca0cfd73e1a62234b8904412b30844 (diff)
downloadpardes-2dbb047a82523c578cb511058c6e1b745cfc8073.tar.gz
pardes-2dbb047a82523c578cb511058c6e1b745cfc8073.zip
A look at a directory opens a pane listing it, as acme's directory window: named dir/, its entries in acme's columns (bytewise, dotfiles kept, a directory's marked /), a look at an entry from there, Get or a look again reads it again, never dirty, Save refused; DirLook terminal keeps ls in a terminal
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/look.zig b/src/look.zig
index a358b31a..0df1f307 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -1787,6 +1787,8 @@ pub fn lookAt(p: *Pardes, id: usize, operand_raw: []const u8) void {
if (t.at.line > pv.page_count) return missedPage(p, id, pv.path, t.at.line);
if (!pv.hitExists(p.pdf_gpa, @max(1, t.at.line), t.at.col)) return missedHit(p, id, pv.path, @max(1, t.at.line), t.at.col);
};
+ // A directory's pane, looked at again: read again.
+ if (target.file) |f| if (f.listing != null) return panes.Dir.show(p, id, t.id);
const before = p.active;
clearNavigationSelection(p, target);
focusPaneLine(p, t.id, t.at, .center);
@@ -1800,6 +1802,9 @@ pub fn lookAt(p: *Pardes, id: usize, operand_raw: []const u8) void {
var said: [4200]u8 = undefined;
return p.reportFailure(id, std.fmt.bufPrint(&said, "look: {s}: no such directory", .{dir[0..@min(dir.len, 4096)]}) catch "look: no such directory");
};
+ // acme's: a pane listing it (Dir.zig). `DirLook terminal`, what
+ // pardes did before: `ls` in a terminal there.
+ if (p.settings.dir_look == .pane) return panes.Dir.look(p, id, dir);
for (p.panes, 0..) |slot, i| {
if (slot) |tt| if (std.mem.eql(u8, tt.cwdSlice(), dir) and exec.takesCommandLine(p, i)) {
clearNavigationSelection(p, tt);