From d2df82ba40c195b04626b562a0fa14d69f5e5d51 Mon Sep 17 00:00:00 2001 From: Marcelo Gimenes de Oliveira Date: Mon, 24 Nov 2025 13:37:28 +0000 Subject: [PATCH] Fix row an col calculation for win without borders --- lua/ergoterm/instance.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/ergoterm/instance.lua b/lua/ergoterm/instance.lua index 86f962f..7a5705f 100644 --- a/lua/ergoterm/instance.lua +++ b/lua/ergoterm/instance.lua @@ -532,8 +532,12 @@ function Terminal:_compute_float_win_config() float_opts.title = float_opts.title or self.name float_opts.height = float_opts.height or math.ceil(math.min(vim.o.lines, math.max(20, vim.o.lines - 5))) float_opts.width = float_opts.width or math.ceil(math.min(vim.o.columns, math.max(80, vim.o.columns - 10))) - float_opts.row = float_opts.row or math.ceil(vim.o.lines - float_opts.height) * 0.5 - 1 - float_opts.col = float_opts.col or math.ceil(vim.o.columns - float_opts.width) * 0.5 - 1 + float_opts.row = float_opts.row or math.ceil(vim.o.lines - float_opts.height) * 0.5 + float_opts.col = float_opts.col or math.ceil(vim.o.columns - float_opts.width) * 0.5 + if float_opts.border ~= 'none' then + float_opts.row = float_opts.row - 1 + float_opts.col = float_opts.col - 1 + end float_opts.zindex = (vim.api.nvim_win_get_config(0).zindex or 0) + 1 return float_opts end