Skip to content

Commit 93f4c5f

Browse files
committed
fix: size_decorator ordering
1 parent 2e834d3 commit 93f4c5f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lua/nvim-tree/renderer/builder.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ function Builder:format_line(indent_markers, arrows, icon, name, node)
235235
add_to_end(line, M.decorators[i]:icons_after(node))
236236
end
237237

238+
local size_extmarks = add_to_end({}, M.decorator_size:icons_right_align(node))
239+
if #size_extmarks > 0 then
240+
self.size_extmarks[self.index] = size_extmarks
241+
end
242+
238243
local rights = {}
239244
for i = #M.decorators, 1, -1 do
240245
add_to_end(rights, M.decorators[i]:icons_right_align(node))
@@ -243,11 +248,6 @@ function Builder:format_line(indent_markers, arrows, icon, name, node)
243248
self.extmarks[self.index] = rights
244249
end
245250

246-
local size_extmarks = add_to_end({}, M.decorator_size:icons_right_align(node))
247-
if #size_extmarks > 0 then
248-
self.size_extmarks[self.index] = size_extmarks
249-
end
250-
251251
return line
252252
end
253253

lua/nvim-tree/renderer/decorator/size.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function DecoratorSize:calculate_icons(node)
123123
end
124124

125125
local size = node and node.fs_stat and node.fs_stat.size or 0
126-
local folder_size_str = self.column_width > 0 and string.rep(" ", self.column_width - 1) .. self.noshow_folder_size_glyph or ""
126+
local folder_size_str = self.column_width > 0 and (string.rep(" ", self.column_width - 1) .. self.noshow_folder_size_glyph) or ""
127127
local icon = {
128128
str = (self.show_folder_size or node.nodes == nil) and self:human_readable_size(size) or folder_size_str,
129129
hl = { "NvimTreeFileSize" },

0 commit comments

Comments
 (0)