Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons: allow setting a string as file icon #71

Merged
merged 1 commit into from
Aug 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/lib/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "✓",
Expand Down
4 changes: 2 additions & 2 deletions lua/lib/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand Down