Skip to content

Commit 7f148f1

Browse files
saviocmcjim-fx
authored andcommitted
Only renders the git icon if the icon is not empty (nvim-tree#633)
1 parent 4d62ac2 commit 7f148f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/nvim-tree/renderer.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,10 @@ if icon_state.show_git_icon then
231231
icons = git_icon_state.dirty
232232
end
233233
for _, v in ipairs(icons) do
234-
table.insert(hl, { v.hl, line, depth+icon_len+#icon, depth+icon_len+#icon+#v.icon })
235-
icon = icon..v.icon..icon_padding
234+
if #v.icon > 0 then
235+
table.insert(hl, { v.hl, line, depth+icon_len+#icon, depth+icon_len+#icon+#v.icon })
236+
icon = icon..v.icon..icon_padding
237+
end
236238
end
237239

238240
return icon

0 commit comments

Comments
 (0)