From 419158b5e0340fead07f91112d71a0a7372efa03 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Mon, 6 Apr 2020 17:10:14 -0600 Subject: [PATCH] Use vim.o for more integrated interface to options --- lua/lazygit.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lua/lazygit.lua b/lua/lazygit.lua index 5748899..6174893 100644 --- a/lua/lazygit.lua +++ b/lua/lazygit.lua @@ -28,14 +28,11 @@ function open_floating_window() api.nvim_buf_set_option(file_buffer, 'bufhidden', 'wipe') api.nvim_buf_set_option(file_buffer, 'filetype', 'lazygit') - local columns = api.nvim_get_option("columns") - local lines = api.nvim_get_option("lines") + local height = math.ceil(vim.o.lines * OPTIONS.lazygit_floating_window_scaling_factor) - 1 + local width = math.ceil(vim.o.columns * OPTIONS.lazygit_floating_window_scaling_factor) - local height = math.ceil(lines * OPTIONS.lazygit_floating_window_scaling_factor) - 1 - local width = math.ceil(columns * OPTIONS.lazygit_floating_window_scaling_factor) - - local row = math.ceil(lines - height) / 2 - local col = math.ceil(columns - width) / 2 + local row = math.ceil(vim.o.lines - height) / 2 + local col = math.ceil(vim.o.columns - width) / 2 local border_opts = { style = "minimal",