Skip to content

Commit 90d7b8e

Browse files
authored
#1253 only pad git icons when they are present (#1259)
1 parent f85af83 commit 90d7b8e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/nvim-tree/renderer/builder.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function Builder:_unwrap_git_data(git_icons_and_hl_groups, offset)
9494
for _, v in ipairs(git_icons_and_hl_groups) do
9595
if #v.icon > 0 then
9696
self:_insert_highlight(v.hl, offset + #icon, offset + #icon + #v.icon)
97-
icon = icon .. v.icon .. self.git_icon_padding
97+
icon = icon .. v.icon
9898
end
9999
end
100100
return icon
@@ -135,11 +135,11 @@ end
135135

136136
function Builder:_format_line(before, after, git_icons)
137137
return string.format(
138-
"%s%s%s %s",
138+
"%s%s%s%s",
139139
before,
140-
self.is_git_after and "" or git_icons,
140+
#git_icons > 0 and not self.is_git_after and git_icons .. self.git_icon_padding or "",
141141
after,
142-
self.is_git_after and git_icons or ""
142+
#git_icons > 0 and self.is_git_after and self.git_icon_padding .. git_icons or ""
143143
)
144144
end
145145

0 commit comments

Comments
 (0)