fix: filetype icon not updating with file change (#119)
This commit is contained in:
parent
ed7d186987
commit
d019c04afc
|
@ -6,12 +6,12 @@ local function filetype(options)
|
||||||
local data = vim.bo.filetype
|
local data = vim.bo.filetype
|
||||||
if #data > 0 then
|
if #data > 0 then
|
||||||
local ok, devicons = pcall(require,'nvim-web-devicons')
|
local ok, devicons = pcall(require,'nvim-web-devicons')
|
||||||
if ok and not options.icon then
|
if ok then
|
||||||
local f_name,f_extension = vim.fn.expand('%:t'),vim.fn.expand('%:e')
|
local f_name,f_extension = vim.fn.expand('%:t'),vim.fn.expand('%:e')
|
||||||
options.icon = devicons.get_icon(f_name,f_extension)
|
options.icon = devicons.get_icon(f_name,f_extension)
|
||||||
else
|
else
|
||||||
ok = vim.fn.exists("*WebDevIconsGetFileTypeSymbol")
|
ok = vim.fn.exists("*WebDevIconsGetFileTypeSymbol")
|
||||||
if ok ~= 0 and not options.icon then
|
if ok ~= 0 then
|
||||||
options.icon = vim.fn.WebDevIconsGetFileTypeSymbol()
|
options.icon = vim.fn.WebDevIconsGetFileTypeSymbol()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue