mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 03:24:13 +00:00
Merge ae2fe94a42
into 6c3bda4aca
This commit is contained in:
commit
18d8b6e446
2 changed files with 5 additions and 4 deletions
|
@ -86,7 +86,7 @@ M.defaults = {
|
||||||
size = { width = 0.8, height = 0.8 },
|
size = { width = 0.8, height = 0.8 },
|
||||||
wrap = true, -- wrap the lines in the ui
|
wrap = true, -- wrap the lines in the ui
|
||||||
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
|
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
|
||||||
border = "none",
|
border = nil,
|
||||||
-- The backdrop opacity. 0 is fully opaque, 100 is fully transparent.
|
-- The backdrop opacity. 0 is fully opaque, 100 is fully transparent.
|
||||||
backdrop = 60,
|
backdrop = 60,
|
||||||
title = nil, ---@type string only works when border is not "none"
|
title = nil, ---@type string only works when border is not "none"
|
||||||
|
|
|
@ -53,7 +53,7 @@ function M:init(opts)
|
||||||
self.opts = vim.tbl_deep_extend("force", {
|
self.opts = vim.tbl_deep_extend("force", {
|
||||||
size = Config.options.ui.size,
|
size = Config.options.ui.size,
|
||||||
style = "minimal",
|
style = "minimal",
|
||||||
border = Config.options.ui.border or "none",
|
border = Config.options.ui.border or vim.o.winborder or "none",
|
||||||
backdrop = Config.options.ui.backdrop or 60,
|
backdrop = Config.options.ui.backdrop or 60,
|
||||||
zindex = 50,
|
zindex = 50,
|
||||||
}, opts or {})
|
}, opts or {})
|
||||||
|
@ -66,7 +66,7 @@ function M:init(opts)
|
||||||
self.win_opts = {
|
self.win_opts = {
|
||||||
relative = "editor",
|
relative = "editor",
|
||||||
style = self.opts.style ~= "" and self.opts.style or nil,
|
style = self.opts.style ~= "" and self.opts.style or nil,
|
||||||
border = self.opts.border,
|
border = self.opts.border or vim.o.winborder,
|
||||||
zindex = self.opts.zindex,
|
zindex = self.opts.zindex,
|
||||||
noautocmd = self.opts.noautocmd,
|
noautocmd = self.opts.noautocmd,
|
||||||
title = self.opts.title,
|
title = self.opts.title,
|
||||||
|
@ -92,7 +92,7 @@ function M:layout()
|
||||||
self.win_opts.row = math.floor((vim.o.lines - self.win_opts.height) / 2)
|
self.win_opts.row = math.floor((vim.o.lines - self.win_opts.height) / 2)
|
||||||
self.win_opts.col = math.floor((vim.o.columns - self.win_opts.width) / 2)
|
self.win_opts.col = math.floor((vim.o.columns - self.win_opts.width) / 2)
|
||||||
|
|
||||||
if self.opts.border ~= "none" then
|
if self.opts.border ~= "none" or vim.o.winborder then
|
||||||
self.win_opts.row = self.win_opts.row - 1
|
self.win_opts.row = self.win_opts.row - 1
|
||||||
self.win_opts.col = self.win_opts.col - 1
|
self.win_opts.col = self.win_opts.col - 1
|
||||||
end
|
end
|
||||||
|
@ -149,6 +149,7 @@ function M:mount()
|
||||||
row = 0,
|
row = 0,
|
||||||
col = 0,
|
col = 0,
|
||||||
style = "minimal",
|
style = "minimal",
|
||||||
|
border = "none",
|
||||||
focusable = false,
|
focusable = false,
|
||||||
zindex = self.opts.zindex - 1,
|
zindex = self.opts.zindex - 1,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue