@@ -141,7 +141,7 @@ function popup.create(what, vim_options)
141
141
-- minheight Minimum height of the contents, excluding border and padding.
142
142
-- maxwidth Maximum width of the contents, excluding border, padding and scrollbar.
143
143
-- minwidth Minimum width of the contents, excluding border, padding and scrollbar.
144
- local width = 0
144
+ local width = vim_options . width or 1
145
145
for _ , v in ipairs (what ) do
146
146
width = math.max (width , # v )
147
147
end
@@ -162,7 +162,11 @@ function popup.create(what, vim_options)
162
162
if vim_options .hidden then
163
163
assert (false , " I have not implemented this yet and don't know how" )
164
164
else
165
- win_id = vim .fn .nvim_open_win (buf , true , win_opts )
165
+ local should_enter = vim_options .enter
166
+ if should_enter == nil then
167
+ should_enter = true
168
+ end
169
+ win_id = vim .fn .nvim_open_win (buf , should_enter , win_opts )
166
170
end
167
171
168
172
@@ -176,7 +180,7 @@ function popup.create(what, vim_options)
176
180
else
177
181
vim .cmd (
178
182
string.format (
179
- " autocmd BufLeave <buffer=%s> ++once call nvim_win_close(%s, v:false)" ,
183
+ " autocmd BufLeave,BufDelete <buffer=%s> ++once call nvim_win_close(%s, v:false)" ,
180
184
buf ,
181
185
win_id
182
186
)
0 commit comments