Skip to content

Commit

Permalink
fix: border scrollbar with termguicolors (closes #1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Dec 16, 2024
1 parent 86faa5a commit 304253e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lua/fzf-lua/win.lua
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,17 @@ function FzfWin:new(o)
local hlgroup = "FzfLuaScrollBorderBackCompat"
self.hls.scrollfloat_f = hlgroup
if utils.__HAS_NVIM_07 then
vim.api.nvim_set_hl(0, hlgroup, { default = false, fg = bg, bg = fg })
vim.api.nvim_set_hl(0, hlgroup,
vim.o.termguicolors and { default = false, fg = bg, bg = fg }
or { default = false, ctermfg = tonumber(bg), ctermbg = tonumber(fg) })
else
vim.cmd(string.format("hi! %s guifg=%s guibg=%s", hlgroup, bg, fg))
if vim.o.termguicolors then
vim.cmd(string.format("hi! %s guifg=%s guibg=%s", hlgroup, bg, fg))
else
vim.cmd(string.format("hi! %s %s %s", hlgroup,
tonumber(bg) and "ctermfg=" .. tostring(bg),
tonumber(fg) and "ctermbg=" .. tostring(fg)))
end
end
end
end
Expand Down

0 comments on commit 304253e

Please sign in to comment.