aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2022-11-07 12:03:16 +0200
committersrdusr <trevorgray@srdusr.com>2022-11-07 12:03:16 +0200
commitf80eb7d293b8d7ee8e671399cce9fdbaf1553c66 (patch)
treefd0db8ad8ce3eef1165022a7eec6e92030d4de35 /lua
parent0806fac4d7b314efb4c388910229b94b6246b3fc (diff)
downloaddotfiles-f80eb7d293b8d7ee8e671399cce9fdbaf1553c66.tar.gz
dotfiles-f80eb7d293b8d7ee8e671399cce9fdbaf1553c66.zip
fixed deprecated flexible component option
Diffstat (limited to 'lua')
-rw-r--r--lua/plugins/heirline.lua50
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