File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ 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
126129
127130 -- TODO: Handle list of lines
128131 if type (what ) == " string" then
Original file line number Diff line number Diff line change @@ -22,6 +22,19 @@ describe("plenary.popup", function()
2222 eq (20 , win_config .width )
2323 end )
2424
25+ it (" can create a very simple window after 'set nomodifiable'" , function ()
26+ vim .o .modifiable = false
27+ local win_id = popup .create (" hello there" , {
28+ line = 1 ,
29+ col = 1 ,
30+ width = 20 ,
31+ })
32+
33+ local win_config = vim .api .nvim_win_get_config (win_id )
34+ eq (20 , win_config .width )
35+ vim .o .modifiable = true
36+ end )
37+
2538 it (" can apply a highlight" , function ()
2639 local win_id = popup .create (" hello there" , {
2740 highlight = " PopupColor1" ,
You can’t perform that action at this time.
0 commit comments