From c96fdfba56a7d543527b7a6c21f2ded5a04c2f31 Mon Sep 17 00:00:00 2001 From: thek4n Date: Fri, 5 Apr 2024 08:50:06 +0300 Subject: [PATCH] ref(nvim-lualine) --- home/user/.config/nvim/lua/base/plugins/lualine.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/home/user/.config/nvim/lua/base/plugins/lualine.lua b/home/user/.config/nvim/lua/base/plugins/lualine.lua index f984050..7128fe0 100644 --- a/home/user/.config/nvim/lua/base/plugins/lualine.lua +++ b/home/user/.config/nvim/lua/base/plugins/lualine.lua @@ -18,6 +18,10 @@ function DETECT_INDENT_TYPE() end end +local function is_absolute_path(path) + return string.sub(path, 1, 1) == '/' or string.sub(path, 1, 1) == '~' +end + return { 'nvim-lualine/lualine.nvim', config = function() @@ -46,7 +50,7 @@ return { fmt = function(str) local res = str - if string.sub(res, 1, 1) == '/' then + if is_absolute_path(res) then res = " " .. res else res = "/" .. res