summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 11:40:11 -0300
committerGabriel Schneider <[email protected]>2026-11-05 12:41:36 -0300
commit3f1533813b6692a736251e4d467a7f108229ddee (patch)
tree37a32c5ebbf9d3af08923856fd6fa516f3b33a39 /src/look.zig
parentcfd2b993feda1b3f7474225bb32db8cac8edc5ae (diff)
downloadpardes-3f1533813b6692a736251e4d467a7f108229ddee.tar.gz
pardes-3f1533813b6692a736251e4d467a7f108229ddee.zip
targets: the DOM web shell goes (src/web.zig and src/web/, its harnesses web_harness, web_snapshot, web_driver_test and web-snapshots/, tools/web_fixture.py, -Dplatform=web, -Ddump, and the web, web-harness, web-snap, web-e2e and web-driver-test steps), and with it what only a freestanding build needed: `hosted` and every guard on it (every build has a host now), memory's stack-fallback arenas and reduced_target sizes, the emscripten main, the tree-sitter libc shim and the stb stub, lsp's has_client, the web arms of the platform switches (-Dplatform is tui, gui or macos); the macOS files pass zig ast-check; docs/web.md is a paragraph on what it was
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/look.zig b/src/look.zig
index f47f0b15..634310f1 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -1223,7 +1223,7 @@ fn lookOpenFailed(p: *Pardes, id: usize, path: []const u8, err: anyerror) void {
var cut: [miss_path_cap + "…".len]u8 = undefined;
// Not there, on a peer's mount as on this host: a miss, the write
// answered, as any path to no file is.
- const remote_missing = if (comptime pardes.hosted) err == error.Remote and std.mem.indexOf(u8, @import("9p_io.zig").Client.lastSaid(), "not exist") != null else false;
+ const remote_missing = err == error.Remote and std.mem.indexOf(u8, @import("9p_io.zig").Client.lastSaid(), "not exist") != null;
if (err == error.FileNotFound or err == error.NotFound or remote_missing)
return missed(p, id, "{s}: no such file", .{missText(path, &cut)});
var said: [miss_path_cap + 16]u8 = undefined;
@@ -1373,7 +1373,7 @@ fn lookUnresolved(p: *Pardes, id: usize, pane: *Pane, trimmed: []const u8, text:
if (filesystem.dotRelative(trimmed)) {
const dir = Pardes.paneDir(pane);
var said: [4200]u8 = undefined;
- const gone = if (comptime pardes.hosted) if (filesystem.localPath(dir)) |local| exec.kindOf(local) != .directory else false else true;
+ const gone = if (filesystem.localPath(dir)) |local| exec.kindOf(local) != .directory else false;
if (gone) return p.reportFailure(id, std.fmt.bufPrint(&said, "look: {s}: no such directory", .{dir[0..@min(dir.len, 4096)]}) catch "look: no such directory");
// A file not there is a miss, as `x` and `/abs/x` are: said and
// logged, the write answered with nothing.
@@ -1411,7 +1411,6 @@ fn lookUnresolved(p: *Pardes, id: usize, pane: *Pane, trimmed: []const u8, text:
/// goes when it succeeds (exec.commandDone).
// ponytail: a hex word that names no commit leaves git's error in a command pane, not a search; check the object first if that bites.
fn lookCommit(p: *Pardes, id: usize, pane: *Pane, word: []const u8) bool {
- if (comptime !pardes.hosted) return false;
if (!isCommitHash(word)) return false;
var dir = filesystem.localPath(Pardes.paneDir(pane)) orelse return false;
while (true) {
@@ -1817,7 +1816,7 @@ pub fn lookAt(p: *Pardes, id: usize, operand_raw: []const u8) void {
.dir => |dir| {
// A directory that is not there (the pane's own, gone): said,
// ENOENT, no terminal made in it.
- if (comptime pardes.hosted) if (filesystem.localPath(dir)) |local| if (exec.kindOf(local) != .directory) {
+ if (filesystem.localPath(dir)) |local| if (exec.kindOf(local) != .directory) {
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");
};