Merge pull request #71 from stsewd/allow-align-icons

Icons: allow setting a string as file icon
This commit is contained in:
Kiyan Yazdani 2020-08-02 18:50:42 +02:00 committed by GitHub
commit 4c073c952a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ local M = {}
function M.get_icon_state()
local show_icons = vim.g.lua_tree_show_icons or { git = 1, folders = 1, files = 1 }
local icons = {
default = nil,
default = "",
git_icons = {
unstaged = "",
staged = "",

View File

@ -29,7 +29,7 @@ if icon_state.show_folder_icon then
end
end
local get_file_icon = function() return "" end
local get_file_icon = function() return icon_state.icons.default end
if icon_state.show_file_icon then
local web_devicons = require'nvim-web-devicons'
@ -158,7 +158,7 @@ local function update_draw_data(tree, depth, markers)
local icon
local git_icons
if special[node.name] then
icon = ""
icon = icon_state.icons.default
git_icons = get_git_icons(node, index, offset, 0)
table.insert(hl, {'LuaTreeSpecialFile', index, offset+#git_icons, -1})
else