332
332
--- @param buf number | nil # buffer number
333
333
--- @param title string # title of the popup
334
334
--- @param size_func function # size_func(editor_width, editor_height) -> width, height, row, col
335
- --- @param opts table # options - gid=nul, on_leave=false, keep_buf =false
335
+ --- @param opts table # options - gid=nul, on_leave=false, persist =false
336
336
--- @param style table # style - border="single"
337
337
--- returns table with buffer, window, close function, resize function
338
338
_H .create_popup = function (buf , title , size_func , opts , style )
@@ -341,7 +341,7 @@ _H.create_popup = function(buf, title, size_func, opts, style)
341
341
local border = style .border or " single"
342
342
343
343
-- create buffer
344
- buf = buf or vim .api .nvim_create_buf (not not opts . persist , not opts .persist )
344
+ buf = buf or vim .api .nvim_create_buf (false , not opts .persist )
345
345
346
346
-- setting to the middle of the editor
347
347
local options = {
@@ -394,7 +394,7 @@ _H.create_popup = function(buf, title, size_func, opts, style)
394
394
if win and vim .api .nvim_win_is_valid (win ) then
395
395
vim .api .nvim_win_close (win , true )
396
396
end
397
- if opts .keep_buf then
397
+ if opts .persist then
398
398
return
399
399
end
400
400
if vim .api .nvim_buf_is_valid (buf ) then
@@ -1559,7 +1559,7 @@ M.open_buf = function(file_name, target, kind, toggle)
1559
1559
local wh = h - (top + bottom )
1560
1560
return ww , wh , top , (w - ww ) / 2
1561
1561
end ,
1562
- { on_leave = false , escape = false , persist = true , keep_buf = true },
1562
+ { on_leave = false , escape = false , persist = true },
1563
1563
{ border = M .config .style_popup_border or " single" }
1564
1564
)
1565
1565
@@ -1613,6 +1613,8 @@ M.open_buf = function(file_name, target, kind, toggle)
1613
1613
return buf
1614
1614
end
1615
1615
1616
+ vim .api .nvim_buf_set_option (buf , " buflisted" , false )
1617
+
1616
1618
if target == M .BufTarget .split or target == M .BufTarget .vsplit then
1617
1619
close = function ()
1618
1620
if vim .api .nvim_win_is_valid (win ) then
0 commit comments