Skip to content

Commit 08e3019

Browse files
fix(popup): set modifiable failed when vim.api.nvim_buf_set_lines (#575)
1 parent 5129a36 commit 08e3019

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lua/plenary/popup/init.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ function popup.create(what, vim_options)
123123
assert(bufnr, "Failed to create buffer")
124124

125125
vim.api.nvim_buf_set_option(bufnr, "bufhidden", "wipe")
126-
if vim.o.modifiable == false then
127-
vim.api.nvim_buf_set_option(bufnr, "modifiable", true)
128-
end
126+
vim.api.nvim_buf_set_option(bufnr, "modifiable", true)
129127

130128
-- TODO: Handle list of lines
131129
if type(what) == "string" then

lua/plenary/window/border.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ function Border:__align_calc_config(content_win_options, border_win_options)
216216
-- Update border characters and title_ranges
217217
self.contents, self.title_ranges = Border._create_lines(self.content_win_id, content_win_options, border_win_options)
218218

219+
vim.api.nvim_buf_set_option(self.bufnr, "modifiable", true)
219220
vim.api.nvim_buf_set_lines(self.bufnr, 0, -1, false, self.contents)
220221

221222
local thickness = border_win_options.border_thickness

0 commit comments

Comments
 (0)