fix: use vim.o.lines
/vim.o.columns
when calculating sidebar height/width (#570)
This commit is contained in:
parent
0642905c80
commit
932535aa99
@ -1503,17 +1503,13 @@ function Sidebar:render(opts)
|
|||||||
local get_height = function()
|
local get_height = function()
|
||||||
local selected_code_size = self:get_selected_code_size()
|
local selected_code_size = self:get_selected_code_size()
|
||||||
|
|
||||||
if self:get_layout() == "horizontal" then
|
if self:get_layout() == "horizontal" then return math.floor(Config.windows.height / 100 * vim.o.lines) end
|
||||||
return math.floor(Config.windows.height / 100 * api.nvim_win_get_height(self.code.winid))
|
|
||||||
end
|
|
||||||
|
|
||||||
return math.max(1, api.nvim_win_get_height(self.code.winid) - selected_code_size - 3 - 8)
|
return math.max(1, api.nvim_win_get_height(self.code.winid) - selected_code_size - 3 - 8)
|
||||||
end
|
end
|
||||||
|
|
||||||
local get_width = function()
|
local get_width = function()
|
||||||
if self:get_layout() == "vertical" then
|
if self:get_layout() == "vertical" then return math.floor(Config.windows.width / 100 * vim.o.columns) end
|
||||||
return math.floor(Config.windows.width / 100 * api.nvim_win_get_width(self.code.winid))
|
|
||||||
end
|
|
||||||
|
|
||||||
return math.max(1, api.nvim_win_get_width(self.code.winid))
|
return math.max(1, api.nvim_win_get_width(self.code.winid))
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user