diff options
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 1cc1c5b8..164bc253 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -1986,6 +1986,7 @@ test "a Look on a directory does not type ls into an occupied terminal" { const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .cols = 100, .rows = 30 }); defer p.deinit(); + p.settings.dir_look = .terminal; // `ls` in a terminal, not a directory pane while (p.nextEffect()) |_| {} var realbuf: [4096]u8 = undefined; @@ -6433,7 +6434,7 @@ pub const Pardes = struct { .owned => |cwd| return cwd, .none => {}, } - if (pane.file) |f| return std.fs.path.dirname(f.path) orelse "/"; + if (pane.file) |f| return panes.Dir.ofName(f.path); if (comptime pdf_enabled) if (pane.pdf) |pv| return std.fs.path.dirname(pv.path) orelse "/"; if (pane.image) |iv| return std.fs.path.dirname(iv.path) orelse "/"; @@ -6807,7 +6808,7 @@ pub const Pardes = struct { return; } - const dir = if (pane.file) |f| (std.fs.path.dirname(f.path) orelse "/") else pane.cwdSlice(); + const dir = if (pane.file) |f| panes.Dir.ofName(f.path) else pane.cwdSlice(); const content = p.gpa.dupe(u8, rows) catch return; const serial_before = p.next_serial; p.fs.refilled = null; @@ -7260,6 +7261,9 @@ pub const Pardes = struct { pane.rows = rows; if (pane.file) |*file| file.syntax_dirty = true; } + // A directory pane's entries follow its width, as acme's + // columns do (Dir.fit). + if (pane.file) |file| if (file.listing != null and r.h > pane.tag_rows) panes.Dir.fit(p, pane, pane.cols); panes.terminal.releasePendingCommandIfReady(p, id, pane); // The greeting `ls` of a new terminal in a directory is typed at // its shell's FIRST prompt, or never: typed later it would land |
