fix(ui): set wo options with local. don't use vim.wo. See #829

This commit is contained in:
Folke Lemaitre 2023-06-12 08:28:10 +02:00
parent 678179543e
commit 7f4da7d511
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 22 additions and 14 deletions

View file

@ -1,5 +1,6 @@
local Config = require("lazy.core.config")
local ViewConfig = require("lazy.view.config")
local Util = require("lazy.util")
---@class LazyFloatOptions
---@field buf? number
@ -124,12 +125,12 @@ function M:mount()
local function opts()
vim.bo[self.buf].bufhidden = self.opts.persistent and "hide" or "wipe"
vim.wo[self.win].conceallevel = 3
vim.wo[self.win].foldenable = false
vim.wo[self.win].spell = false
vim.wo[self.win].wrap = true
vim.wo[self.win].winhighlight = "Normal:LazyNormal"
vim.wo[self.win].colorcolumn = ""
Util.wo(self.win, "conceallevel", 3)
Util.wo(self.win, "foldenable", false)
Util.wo(self.win, "spell", false)
Util.wo(self.win, "wrap", true)
Util.wo(self.win, "winhighlight", "Normal:LazyNormal")
Util.wo(self.win, "colorcolumn", "")
end
opts()

View file

@ -57,12 +57,11 @@ function M.create()
})
if Config.options.ui.wrap then
vim.wo[self.win].wrap = true
vim.wo[self.win].linebreak = true
vim.wo[self.win].breakindent = true
-- vim.wo[self.win].breakindentopt = "shift:8"
Util.wo(self.win, "wrap", true)
Util.wo(self.win, "linebreak", true)
Util.wo(self.win, "breakindent", true)
else
vim.wo[self.win].wrap = false
Util.wo(self.win, "wrap", false)
end
self.state = vim.deepcopy(default_state)