From 4c983dc363f62416e6b9a6dda0bd18679d3e4593 Mon Sep 17 00:00:00 2001 From: Caps Lock <46106832+capsey@users.noreply.github.com> Date: Fri, 15 Nov 2024 12:11:21 +0100 Subject: [PATCH] fix: file_icon() causes an error --- lua/tabby/feature/bufs.lua | 2 +- lua/tabby/module/file_name_resolver.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/tabby/feature/bufs.lua b/lua/tabby/feature/bufs.lua index 544fb5a..ca49b71 100644 --- a/lua/tabby/feature/bufs.lua +++ b/lua/tabby/feature/bufs.lua @@ -26,7 +26,7 @@ function M.new_buf(bufid, opt) if vim.fn.isdirectory(vim.api.nvim_buf_get_name(bufid)) == 1 then return '' end - local name = require('tabby.faature.buf_name').get(bufid, { mode = 'tail' }) + local name = require('tabby.feature.buf_name').get(bufid, { mode = 'tail' }) local extension = vim.fn.fnamemodify(name, ':e') return api.get_icon(name, extension) end, diff --git a/lua/tabby/module/file_name_resolver.lua b/lua/tabby/module/file_name_resolver.lua index fd330c6..9948c5b 100644 --- a/lua/tabby/module/file_name_resolver.lua +++ b/lua/tabby/module/file_name_resolver.lua @@ -104,7 +104,7 @@ local transformers = { ---@param fallback fun(handler:number):string ---@return string function FileNameResolver:get_other_name(handler, mode, fallback) - local name = self.loader(handler) + local name = self.loader.get_name(handler) if not name then name = fallback(handler) else @@ -127,7 +127,7 @@ function FileNameResolver:get_name(handler, mode, fallback) if mode == 'unique' then return self:get_unique_name(handler, fallback) else - return self:get_other_name(handler, self.mode --[[@as 'relative'|'tail'|'shorten']], fallback) + return self:get_other_name(handler, mode --[[@as 'relative'|'tail'|'shorten']], fallback) end end