fix: do not restore project MRU history for files that don't exist
This commit is contained in:
parent
a1ba46cba8
commit
267ccdd069
1 changed files with 5 additions and 0 deletions
|
@ -87,6 +87,11 @@ pub fn restore_state(self: *Self, data: []const u8) !void {
|
||||||
else => return e,
|
else => return e,
|
||||||
}) {
|
}) {
|
||||||
self.longest_file_path = @max(self.longest_file_path, path.len);
|
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);
|
try self.update_mru_internal(path, mtime, row, col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue