Skip to content

Commit

Permalink
fix(provider): use modified highlight on oil and unnamed buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
bwpge committed May 31, 2024
1 parent 1ff66ba commit 100edfa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lua/lualine-pretty-path/providers/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion lua/lualine-pretty-path/providers/oil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 100edfa

Please sign in to comment.