fix edgecase for nonicon filetypes in statusline
This commit is contained in:
parent
9b7b44f74f
commit
56c9b087ea
|
@ -252,14 +252,19 @@ options.file_info = {
|
||||||
local filename = fn.expand "%:t"
|
local filename = fn.expand "%:t"
|
||||||
local extension = fn.expand "%:e"
|
local extension = fn.expand "%:e"
|
||||||
|
|
||||||
|
if filename == "" then
|
||||||
|
return options.icons.empty_file
|
||||||
|
end
|
||||||
|
|
||||||
local icon = require("nvim-web-devicons").get_icon(filename, extension)
|
local icon = require("nvim-web-devicons").get_icon(filename, extension)
|
||||||
|
|
||||||
if icon == nil and fn.expand "%:t" == "" then
|
if icon == nil then
|
||||||
return options.icons.empty_file
|
icon = " "
|
||||||
else
|
else
|
||||||
icon = icon .. " " or " "
|
icon = icon .. " "
|
||||||
return icon
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return icon
|
||||||
end,
|
end,
|
||||||
|
|
||||||
hl = "Feline_file_info",
|
hl = "Feline_file_info",
|
||||||
|
|
Loading…
Reference in New Issue