Skip to content

Commit 637b919

Browse files
committed
fix: accept booleans for border
1 parent e69019e commit 637b919

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lua/popup/init.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function popup.create(what, vim_options)
221221

222222
-- Create border
223223

224-
local should_show_border = false
224+
local should_show_border = nil
225225
local border_options = {}
226226

227227
-- border List with numbers, defining the border thickness
@@ -231,7 +231,7 @@ function popup.create(what, vim_options)
231231
if vim_options.border then
232232
should_show_border = true
233233

234-
if vim.tbl_isempty(vim_options.border) then
234+
if type(vim_options.border) == 'boolean' or vim.tbl_isempty(vim_options.border) then
235235
border_options.border_thickness = Border._default_thickness
236236
elseif #vim_options.border == 4 then
237237
border_options.border_thickness = {
@@ -246,9 +246,11 @@ function popup.create(what, vim_options)
246246
vim.inspect(vim_options.border)
247247
))
248248
end
249+
elseif vim_options.border == false then
250+
should_show_border = false
249251
end
250252

251-
if should_show_border or vim_options.borderchars then
253+
if (should_show_border == nil or should_show_border) and vim_options.borderchars then
252254
should_show_border = true
253255

254256
-- borderchars List with characters, defining the character to use
@@ -295,7 +297,6 @@ function popup.create(what, vim_options)
295297
-- title
296298
if vim_options.title then
297299
-- TODO: Check out how title works with weird border combos.
298-
should_show_border = true
299300
border_options.title = vim_options.title
300301
end
301302

0 commit comments

Comments
 (0)