mirror of https://github.com/folke/lazy.nvim.git
fix(ui): take border into account for window position. Fixes #812
This commit is contained in:
parent
5f316cea4f
commit
451f217e9b
|
@ -35,7 +35,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,
|
border = Config.options.ui.border or "none",
|
||||||
zindex = 50,
|
zindex = 50,
|
||||||
}, opts or {})
|
}, opts or {})
|
||||||
|
|
||||||
|
@ -66,6 +66,11 @@ 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
|
||||||
|
self.win_opts.row = self.win_opts.row - 1
|
||||||
|
self.win_opts.col = self.win_opts.col - 1
|
||||||
|
end
|
||||||
|
|
||||||
if self.opts.margin then
|
if self.opts.margin then
|
||||||
if self.opts.margin.top then
|
if self.opts.margin.top then
|
||||||
self.win_opts.height = self.win_opts.height - self.opts.margin.top
|
self.win_opts.height = self.win_opts.height - self.opts.margin.top
|
||||||
|
|
Loading…
Reference in New Issue