fix: do not restore project MRU history for files that don't exist

This commit is contained in:
CJ van den Berg 2024-08-30 22:03:18 +02:00
parent a1ba46cba8
commit 267ccdd069
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -87,6 +87,11 @@ pub fn restore_state(self: *Self, data: []const u8) !void {
else => return e,
}) {
self.longest_file_path = @max(self.longest_file_path, path.len);
const stat = std.fs.cwd().statFile(path) catch return;
switch (stat.kind) {
.sym_link, .file => {},
else => return,
}
try self.update_mru_internal(path, mtime, row, col);
}
}