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

@ -10,6 +10,14 @@ function M.float(opts)
return require("lazy.view.float")(opts)
end
function M.wo(win, k, v)
if vim.api.nvim_set_option_value then
vim.api.nvim_set_option_value(k, v, { scope = "local", win = win })
else
vim.wo[win][k] = v
end
end
function M.open(uri)
if M.file_exists(uri) then
return M.float({ style = "", file = uri })
@ -180,9 +188,9 @@ function M.markdown(msg, opts)
vim.tbl_deep_extend("force", {
title = "lazy.nvim",
on_open = function(win)
vim.wo[win].conceallevel = 3
vim.wo[win].concealcursor = "n"
vim.wo[win].spell = false
M.wo(win, "conceallevel", 3)
M.wo(win, "concealcursor", "n")
M.wo(win, "spell", false)
vim.treesitter.start(vim.api.nvim_win_get_buf(win), "markdown")
end,