Skip to content

Commit 90498cb

Browse files
committed
stream updates
1 parent 64b7127 commit 90498cb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lua/popup/border.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function Border._create_lines(content_win_options, border_win_options)
5858
local middle_line = string.format(
5959
"%s%s%s",
6060
(left_enabled and border_win_options.left) or '',
61-
string.rep('~', content_win_options.width),
61+
string.rep(' ', content_win_options.width),
6262
(right_enabled and border_win_options.right) or ''
6363
)
6464

lua/popup/init.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function popup.create(what, vim_options)
141141
-- minheight Minimum height of the contents, excluding border and padding.
142142
-- maxwidth Maximum width of the contents, excluding border, padding and scrollbar.
143143
-- minwidth Minimum width of the contents, excluding border, padding and scrollbar.
144-
local width = 0
144+
local width = vim_options.width or 1
145145
for _, v in ipairs(what) do
146146
width = math.max(width, #v)
147147
end
@@ -162,7 +162,11 @@ function popup.create(what, vim_options)
162162
if vim_options.hidden then
163163
assert(false, "I have not implemented this yet and don't know how")
164164
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)
166170
end
167171

168172

@@ -176,7 +180,7 @@ function popup.create(what, vim_options)
176180
else
177181
vim.cmd(
178182
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)",
180184
buf,
181185
win_id
182186
)

0 commit comments

Comments
 (0)