diff options
Diffstat (limited to 'lua/plugins/heirline.lua')
| -rw-r--r-- | lua/plugins/heirline.lua | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/lua/plugins/heirline.lua b/lua/plugins/heirline.lua index b8c51f1..c05844b 100644 --- a/lua/plugins/heirline.lua +++ b/lua/plugins/heirline.lua @@ -603,30 +603,32 @@ local WordCount = { -- Working Directory local WorkDir = { - provider = function(self) - self.icon = (vim.fn.haslocaldir(0) == 1 and "l" or "g") .. " " .. " " - local cwd = vim.fn.getcwd(0) - self.cwd = vim.fn.fnamemodify(cwd, ":~") - end, - hl = { fg = colors.blue, bold = true, bg = colors.bg }, - - utils.make_flexible_component(1, { - -- evaluates to the full-lenth path - provider = function(self) - local trail = self.cwd:sub(-1) == "/" and "" or "/" - return self.icon .. self.cwd .. trail .. " " - end, - }, { - -- evaluates to the shortened path - provider = function(self) - local cwd = vim.fn.pathshorten(self.cwd) - local trail = self.cwd:sub(-1) == "/" and "" or "/" - return self.icon .. cwd .. trail .. " " - end, - }, { - -- evaluates to "", hiding the component - provider = "", - }), + init = function(self) + self.icon = (vim.fn.haslocaldir(0) == 1 and "l" or "g") .. " " .. " " + local cwd = vim.fn.getcwd(0) + self.cwd = vim.fn.fnamemodify(cwd, ":~") + end, + hl = { fg = "colors.blue", bold = true }, + flexible = 1, + { + -- evaluates to the full-lenth path + provider = function(self) + local trail = self.cwd:sub(-1) == "/" and "" or "/" + return self.icon .. self.cwd .. trail .." " + end, + }, + { + -- evaluates to the shortened path + provider = function(self) + local cwd = vim.fn.pathshorten(self.cwd) + local trail = self.cwd:sub(-1) == "/" and "" or "/" + return self.icon .. cwd .. trail .. " " + end, + }, + { + -- evaluates to "", hiding the component + provider = "", + } } -- Snippets Indicator |
