aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--doc/mason.txt3
-rw-r--r--lua/mason-core/ui/display.lua3
-rw-r--r--lua/mason/settings.lua3
-rw-r--r--lua/mason/ui/instance.lua12
5 files changed, 19 insertions, 5 deletions
diff --git a/README.md b/README.md
index ca52b231..d12e7a20 100644
--- a/README.md
+++ b/README.md
@@ -267,7 +267,8 @@ local DEFAULT_SETTINGS = {
---@since 1.0.0
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
- border = "none",
+ -- Defaults to `:h 'winborder'` if nil.
+ border = nil,
---@since 1.11.0
-- The backdrop opacity. 0 is fully opaque, 100 is fully transparent.
diff --git a/doc/mason.txt b/doc/mason.txt
index 4af3b91a..7d5fa72d 100644
--- a/doc/mason.txt
+++ b/doc/mason.txt
@@ -329,7 +329,8 @@ Example:
---@since 1.0.0
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
- border = "none",
+ -- Defaults to `:h 'winborder'` if nil.
+ border = nil,
---@since 1.11.0
-- The backdrop opacity. 0 is fully opaque, 100 is fully transparent.
diff --git a/lua/mason-core/ui/display.lua b/lua/mason-core/ui/display.lua
index a9e63910..72583a70 100644
--- a/lua/mason-core/ui/display.lua
+++ b/lua/mason-core/ui/display.lua
@@ -185,7 +185,7 @@ local function create_popup_window_opts(opts, sizes_only)
local width = calc_size(settings.current.ui.width, columns)
local row = math.floor((lines - height) / 2)
local col = math.floor((columns - width) / 2)
- if opts.border ~= "none" then
+ if opts.border ~= "none" and opts.border ~= "" then
row = math.max(row - 1, 0)
col = math.max(col - 1, 0)
end
@@ -216,6 +216,7 @@ local function create_backdrop_window_opts()
col = 0,
style = "minimal",
focusable = false,
+ border = "none",
zindex = 44,
}
end
diff --git a/lua/mason/settings.lua b/lua/mason/settings.lua
index 895dfd0c..ebff1e0b 100644
--- a/lua/mason/settings.lua
+++ b/lua/mason/settings.lua
@@ -75,7 +75,8 @@ local DEFAULT_SETTINGS = {
---@since 1.0.0
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
- border = "none",
+ -- Defaults to `:h 'winborder'` if nil.
+ border = nil,
---@since 1.11.0
-- The backdrop opacity. 0 is fully opaque, 100 is fully transparent.
diff --git a/lua/mason/ui/instance.lua b/lua/mason/ui/instance.lua
index f5bf6f04..a49c585b 100644
--- a/lua/mason/ui/instance.lua
+++ b/lua/mason/ui/instance.lua
@@ -735,9 +735,19 @@ else
end)
end
+local border = settings.current.ui.border
+
+if border == nil then
+ if vim.fn.has "nvim-0.11" == 1 then
+ border = vim.o.winborder
+ else
+ border = "none"
+ end
+end
+
window.init {
effects = effects,
- border = settings.current.ui.border,
+ border = border,
winhighlight = {
"NormalFloat:MasonNormal",
},