Slight cleanup in make_entry_file(); make buffer list pass correct filename to get_devicon()

main
John Drouhard 3 years ago committed by ibhagwan
parent c78712c407
commit d04dc95a94

@ -155,12 +155,7 @@ end
M.make_entry_file = function(opts, x)
local icon, hl
local ret = {}
local file = x
for s in string.gmatch(x, '[^:]+') do
file = s
break
end
file = utils.strip_ansi_coloring(file)
local file = utils.strip_ansi_coloring(string.match(x, '[^:]*'))
if opts.cwd_only and path.starts_with_separator(file) then
local cwd = opts.cwd or vim.loop.cwd()
if not path.is_relative(file, cwd) then

@ -116,8 +116,9 @@ M.buffers = function(opts)
-- get shell-like icon for terminal buffers
buficon, hl = core.get_devicon(buf.info.name, "sh")
else
local extension = path.extension(buf.info.name)
buficon, hl = core.get_devicon(buf.info.name, extension)
local filename = path.tail(buf.info.name)
local extension = path.extension(filename)
buficon, hl = core.get_devicon(filename, extension)
end
if opts.color_icons then
buficon = utils.ansi_codes[hl](buficon)

Loading…
Cancel
Save