Skip to content

Commit

Permalink
fix(ui): reset buf and win options on resize
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 11, 2023
1 parent 5aca928 commit 3b44c3c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lua/lazy/view/float.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ function M:mount()
if vim.bo[self.buf].filetype == "" then
vim.bo[self.buf].filetype = "lazy"
end
vim.bo[self.buf].bufhidden = "wipe"
vim.wo[self.win].conceallevel = 3
vim.wo[self.win].spell = false
vim.wo[self.win].wrap = true
vim.wo[self.win].winhighlight = "Normal:LazyNormal"

local function opts()
vim.bo[self.buf].bufhidden = "wipe"
vim.wo[self.win].conceallevel = 3
vim.wo[self.win].spell = false
vim.wo[self.win].wrap = true
vim.wo[self.win].winhighlight = "Normal:LazyNormal"
end
opts()

vim.api.nvim_create_autocmd("VimResized", {
callback = function()
Expand All @@ -120,7 +124,9 @@ function M:mount()
---@diagnostic disable-next-line: no-unknown
config[key] = self.win_opts[key]
end
config.style = self.opts.style ~= "" and self.opts.style or nil
vim.api.nvim_win_set_config(self.win, config)
opts()
vim.cmd([[do User LazyFloatResized]])
end,
})
Expand Down

0 comments on commit 3b44c3c

Please sign in to comment.