fix: walk_tree file type should use cached config values
This commit is contained in:
parent
195ba1e385
commit
0e0137677f
1 changed files with 3 additions and 2 deletions
|
|
@ -600,12 +600,13 @@ pub fn walk_tree_entry(self: *Self, m: tp.message) OutOfMemoryError!void {
|
||||||
tp.extract(&file_color),
|
tp.extract(&file_color),
|
||||||
}) catch return)) return;
|
}) catch return)) return;
|
||||||
const mtime = (@as(i128, @intCast(mtime_high)) << 64) | @as(i128, @intCast(mtime_low));
|
const mtime = (@as(i128, @intCast(mtime_high)) << 64) | @as(i128, @intCast(mtime_low));
|
||||||
|
const ft = file_type_config.get(file_type) catch null;
|
||||||
|
|
||||||
self.longest_file_path = @max(self.longest_file_path, file_path.len);
|
self.longest_file_path = @max(self.longest_file_path, file_path.len);
|
||||||
(try self.pending.addOne(self.allocator)).* = .{
|
(try self.pending.addOne(self.allocator)).* = .{
|
||||||
.path = try self.allocator.dupe(u8, file_path),
|
.path = try self.allocator.dupe(u8, file_path),
|
||||||
.type = file_type,
|
.type = if (ft) |ft_| ft_.name else try self.allocator.dupe(u8, file_type),
|
||||||
.icon = file_icon,
|
.icon = if (ft) |ft_| ft_.icon orelse &.{} else try self.allocator.dupe(u8, file_icon),
|
||||||
.color = @intCast(file_color),
|
.color = @intCast(file_color),
|
||||||
.mtime = mtime,
|
.mtime = mtime,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue