Skip to content

Commit

Permalink
fix(popup): use popup winblend for border
Browse files Browse the repository at this point in the history
  • Loading branch information
MunifTanjim committed Nov 26, 2023
1 parent c1627d0 commit 257dccc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/nui/popup/border.lua
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ function Border:_open_window()
_.set_win_option(self.winid, "winhighlight", self._.winhighlight)
end

if self.popup._.win_options.winblend then
_.set_win_option(self.winid, "winblend", self.popup._.win_options.winblend)
end

adjust_popup_win_config(self)

vim.api.nvim_command("redraw")
Expand Down
20 changes: 20 additions & 0 deletions tests/nui/popup/border_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,26 @@ describe("nui.popup", function()
popup:unmount()
end)

it("sets winblend from popup", function()
popup_options = vim.tbl_deep_extend("force", popup_options, {
border = {
style = "rounded",
text = {
top = "text",
},
},
win_options = {
winblend = 20,
},
})

popup = Popup(popup_options)

popup:mount()

eq(vim.api.nvim_win_get_option(popup.border.winid, "winblend"), 20)
end)

it("sets winhighlight correctly", function()
local hl_group = "NuiPopupTest"
local winhighlight = "Normal:Normal,FloatBorder:" .. hl_group
Expand Down

0 comments on commit 257dccc

Please sign in to comment.