From cd54b5a954d0c6fdcc41f5a91da9d9513b668773 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 7 Oct 2025 10:25:24 +0200 Subject: [PATCH] fix(wsl): assume kind file if statFile fails --- src/Project.zig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Project.zig b/src/Project.zig index 4f5e757..66bacf1 100644 --- a/src/Project.zig +++ b/src/Project.zig @@ -196,7 +196,10 @@ pub fn restore_state_v1(self: *Self, data: []const u8) !void { } tp.trace(tp.channel.debug, .{ "restore_state_v1", "file", path, mtime, row, col }); self.longest_file_path = @max(self.longest_file_path, path.len); - const stat = std.fs.cwd().statFile(path) catch continue; + const stat = std.fs.cwd().statFile(path) catch { + try self.update_mru_internal(path, mtime, row, col); + continue; + }; switch (stat.kind) { .sym_link, .file => try self.update_mru_internal(path, mtime, row, col), else => {}, @@ -260,7 +263,10 @@ pub fn restore_state_v0(self: *Self, data: []const u8) error{ }) { tp.trace(tp.channel.debug, .{ "restore_state_v0", "file", path, mtime, row, col }); self.longest_file_path = @max(self.longest_file_path, path.len); - const stat = std.fs.cwd().statFile(path) catch continue; + const stat = std.fs.cwd().statFile(path) catch { + try self.update_mru_internal(path, mtime, row, col); + continue; + }; switch (stat.kind) { .sym_link, .file => try self.update_mru_internal(path, mtime, row, col), else => {},