Fix floating_window_scaling_factor being a table or float
This commit is contained in:
@@ -46,8 +46,14 @@ end
|
|||||||
|
|
||||||
local function open_floating_window()
|
local function open_floating_window()
|
||||||
|
|
||||||
local height = math.ceil(vim.o.lines * vim.g.lazygit_floating_window_scaling_factor[false]) - 1
|
local floating_window_scaling_factor = vim.g.lazygit_floating_window_scaling_factor
|
||||||
local width = math.ceil(vim.o.columns * vim.g.lazygit_floating_window_scaling_factor[false])
|
|
||||||
|
if type(floating_window_scaling_factor) == 'table' then
|
||||||
|
floating_window_scaling_factor = floating_window_scaling_factor[false]
|
||||||
|
end
|
||||||
|
|
||||||
|
local height = math.ceil(vim.o.lines * floating_window_scaling_factor) - 1
|
||||||
|
local width = math.ceil(vim.o.columns * floating_window_scaling_factor)
|
||||||
|
|
||||||
local row = math.ceil(vim.o.lines - height) / 2
|
local row = math.ceil(vim.o.lines - height) / 2
|
||||||
local col = math.ceil(vim.o.columns - width) / 2
|
local col = math.ceil(vim.o.columns - width) / 2
|
||||||
|
|||||||
Reference in New Issue
Block a user