Skip to content

Commit feb1a23

Browse files
authored
Merge pull request #794 from NeogitOrg/fix-respect-reverse
2 parents 800a366 + 080aaf4 commit feb1a23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/neogit/lib/hl.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ local function get_fg(name)
3232
local color = vim.api.nvim_get_hl(0, { name = name })
3333
if color["link"] then
3434
return get_fg(color["link"])
35-
elseif color["reverse"] then
35+
elseif color["reverse"] and color["bg"] then
3636
return "#" .. to_hex(color["bg"])
3737
elseif color["fg"] then
3838
return "#" .. to_hex(color["fg"])
@@ -44,7 +44,7 @@ local function get_bg(name)
4444
local color = vim.api.nvim_get_hl(0, { name = name })
4545
if color["link"] then
4646
return get_bg(color["link"])
47-
elseif color["reverse"] then
47+
elseif color["reverse"] and color["fg"] then
4848
return "#" .. to_hex(color["fg"])
4949
elseif color["bg"] then
5050
return "#" .. to_hex(color["bg"])

0 commit comments

Comments
 (0)