From 3b44c3c14ad69e7a26ae6408816f332af58202c3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 11 Jan 2023 13:43:17 +0100 Subject: [PATCH] fix(ui): reset buf and win options on resize --- lua/lazy/view/float.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lua/lazy/view/float.lua b/lua/lazy/view/float.lua index 6b22052..a4a05b0 100644 --- a/lua/lazy/view/float.lua +++ b/lua/lazy/view/float.lua @@ -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() @@ -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, })