Skip to content

Commit a49df0f

Browse files
authored
fix: handle winborder correctly if the global option is not set (#173)
1 parent fe66681 commit a49df0f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lua/crates/popup/common.lua

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,17 @@ local function popup_border()
178178
---@type string[]
179179
local winborder = vim.opt_global.winborder:get()
180180

181-
-- This returns { "<value>" } if something like "single" or "rounded"
182-
-- is set, or a list of border chars.
183-
return #winborder == 1 and winborder[1] or winborder
181+
-- This returns:
182+
-- * An empty list if unset, or
183+
-- * { "<value>" } if something like "single" or "rounded" is set, or
184+
-- * A list of border chars.
185+
if #winborder == 0 then
186+
return "none"
187+
elseif #winborder == 1 then
188+
return winborder[1]
189+
else
190+
return winborder
191+
end
184192
else
185193
return "none"
186194
end

0 commit comments

Comments
 (0)