change icon selection
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user