File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ function popup.create(what, vim_options)
123
123
assert (bufnr , " Failed to create buffer" )
124
124
125
125
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
129
127
130
-- TODO: Handle list of lines
128
131
if type (what ) == " string" then
Original file line number Diff line number Diff line change @@ -22,6 +22,19 @@ describe("plenary.popup", function()
22
22
eq (20 , win_config .width )
23
23
end )
24
24
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
+
25
38
it (" can apply a highlight" , function ()
26
39
local win_id = popup .create (" hello there" , {
27
40
highlight = " PopupColor1" ,
You can’t perform that action at this time.
0 commit comments