change icon selection

This commit is contained in:
kiyan42
2020-03-05 11:52:32 +01:00
parent abaf0775a8
commit 7e3ff3db86
5 changed files with 29 additions and 19 deletions

View File

@@ -10,9 +10,11 @@ end
local HAS_DEV_ICONS = api.nvim_call_function('exists', { "*WebDevIconsGetFileTypeSymbol" }) == 1
local SHOW_FOLDER_ICON = get('lua_tree_show_folders', 1) == 1
local show_icons = get('lua_tree_show_icons', { git = 1, folders = 1, files = 1 })
local SHOW_GIT_ICON = get('lua_tree_show_git_icons', 1) == 1
local SHOW_FILE_ICON = HAS_DEV_ICONS and show_icons.files == 1
local SHOW_FOLDER_ICON = show_icons.folders == 1
local SHOW_GIT_ICON = show_icons.git == 1
local colors = {
red = get('terminal_color_1', 'Red'),
@@ -26,7 +28,7 @@ local colors = {
}
return {
SHOW_FOLDER_ICON = SHOW_FOLDER_ICON,
HAS_DEV_ICONS = HAS_DEV_ICONS,
SHOW_FILE_ICON = SHOW_FILE_ICON,
SHOW_GIT_ICON = SHOW_GIT_ICON,
colors = colors
}

View File

@@ -59,7 +59,7 @@ local function dev_icons(pathname, isdir, open)
end
local function get_icon_func_gen()
if config.HAS_DEV_ICONS then
if config.SHOW_FILE_ICON then
return dev_icons
else
return default_icons
@@ -140,7 +140,7 @@ local function highlight_line(buffer)
elseif is_pic(node.path .. node.name) then
highlight('LuaTreeImageFile', line, text_start + gitlen, -1)
elseif config.HAS_DEV_ICONS then
elseif config.SHOW_FILE_ICON then
for k, v in pairs(HIGHLIGHT_GROUPS) do
if string.match(node.name, k) ~= nil then
text_start = text_start + 4