Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(popup): set modifiable failed when vim.api.nvim_buf_set_lines #575

Merged
merged 12 commits into from
Apr 25, 2024
Merged
7 changes: 4 additions & 3 deletions lua/plenary/popup/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ end
function popup.create(what, vim_options)
vim_options = vim.deepcopy(vim_options)

if vim.o.modifiable == false then
vim.o.modifiable = true
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this just enables this globally. change this setting, we probably dont want this?!


local bufnr
if type(what) == "number" then
bufnr = what
Expand All @@ -123,9 +127,6 @@ function popup.create(what, vim_options)
assert(bufnr, "Failed to create buffer")

vim.api.nvim_buf_set_option(bufnr, "bufhidden", "wipe")
if vim.o.modifiable == false then
vim.api.nvim_buf_set_option(bufnr, "modifiable", true)
end

-- TODO: Handle list of lines
if type(what) == "string" then
Expand Down
Loading