diff options
Diffstat (limited to 'src/look.zig')
| -rw-r--r-- | src/look.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/look.zig b/src/look.zig index d60ff3a9..7af69c55 100644 --- a/src/look.zig +++ b/src/look.zig @@ -187,7 +187,7 @@ pub const Target = union(enum) { dir: []const u8, // resolved absolute path, in caller's buf file: FileTarget, /// A file a kind opens (Kind.forPath): a picture. - kind: struct { path: []const u8, ops: *const Kind.Ops }, + kind: struct { path: []const u8, kind: u8 }, url: []const u8, pane: struct { id: usize, at: Spot }, }; @@ -371,7 +371,8 @@ pub fn resolve(p: ?*pardes.Pardes, word_raw: []const u8, cwd: []const u8, realbu .at = pl.at, .kind = .pdf, } }; - if (Kind.forPath(found.path)) |ops| return .{ .kind = .{ .path = found.path, .ops = ops } }; + var compiled_in: Kind.Registry = if (p == null) .init() else .{}; + if ((if (p) |pp| &pp.kinds else &compiled_in).forPath(found.path)) |k| return .{ .kind = .{ .path = found.path, .kind = k } }; return .{ .file = .{ .path = found.path, .at = pl.at } }; } @@ -1880,7 +1881,7 @@ pub fn lookAt(p: *Pardes, id: usize, operand_raw: []const u8) void { .kind => |target| { if (focusPaneByPath(p, target.path, .{})) return; const free = p.freeSlot() orelse return p.reportError(id, "look", error.NoPaneSlots); - const made = Kind.openFile(p, free, target.ops, target.path) catch |err| + const made = Kind.openFile(p, free, target.kind, target.path) catch |err| return lookOpenFailed(p, id, target.path, err); // One its kind refuses (an image corrupt, truncated, not what // its name says) is said, a failure, rather than shown blank. |
