From 8529daa38242091d579ed24f28b35c8b80928e8a Mon Sep 17 00:00:00 2001 From: William Boman Date: Sat, 14 Jan 2023 12:59:00 +0100 Subject: feat(ui): nicer bottom offset (#905) This ensures that the window doesn't overlap the status bar. --- lua/mason-core/ui/display.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/mason-core/ui/display.lua b/lua/mason-core/ui/display.lua index 3c143390..85e73523 100644 --- a/lua/mason-core/ui/display.lua +++ b/lua/mason-core/ui/display.lua @@ -172,7 +172,11 @@ M._render_node = render_node local function create_popup_window_opts(opts, sizes_only) local columns = vim.o.columns local top_offset = 1 - local height = vim.o.lines - math.max(vim.o.cmdheight, top_offset) - top_offset + local bottom_offset = 1 + vim.o.cmdheight + if vim.o.laststatus == 0 then + bottom_offset = math.max(bottom_offset - 1, 1) + end + local height = vim.o.lines - bottom_offset - top_offset local width = math.floor(columns * 0.8) local popup_layout = { height = height, -- cgit v1.2.3-70-g09d2