From 100edfa46ad3470c327ddf8a3e485c1a94d9fbea Mon Sep 17 00:00:00 2001 From: bwpge Date: Thu, 30 May 2024 22:58:24 -0400 Subject: [PATCH] fix(provider): use modified highlight on oil and unnamed buffers --- lua/lualine-pretty-path/providers/base.lua | 6 +++--- lua/lualine-pretty-path/providers/oil.lua | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lua/lualine-pretty-path/providers/base.lua b/lua/lualine-pretty-path/providers/base.lua index f9bfb35..3817153 100644 --- a/lua/lualine-pretty-path/providers/base.lua +++ b/lua/lualine-pretty-path/providers/base.lua @@ -222,10 +222,10 @@ function M:render_name() end local name_hl = "" - if self:is_unnamed() then - name_hl = self.opts.highlights.unnamed - elseif self:is_modified() then + if self:is_modified() then name_hl = self.opts.highlights.modified + elseif self:is_unnamed() then + name_hl = self.opts.highlights.unnamed elseif self:is_new() then name_hl = self.opts.highlights.newfile else diff --git a/lua/lualine-pretty-path/providers/oil.lua b/lua/lualine-pretty-path/providers/oil.lua index 9b938ba..d0e54f0 100644 --- a/lua/lualine-pretty-path/providers/oil.lua +++ b/lua/lualine-pretty-path/providers/oil.lua @@ -16,7 +16,12 @@ function M:render_dir() local dir = self.super.render_dir(self) or "" dir = dir:sub(1, #dir - #self.path_sep) -- remove trailing separator - return self.hl(dir, self.opts.highlights.filename) + local hl = self.opts.highlights.filename + if self:is_modified() then + hl = self.opts.highlights.modified + end + + return self.hl(dir, hl) end function M:render()