aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/ui
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-01-14 12:59:00 +0100
committerGitHub <noreply@github.com>2023-01-14 11:59:00 +0000
commit8529daa38242091d579ed24f28b35c8b80928e8a (patch)
tree93c3af27dd1c798ec84cdd34ebb3951b7ac276d0 /lua/mason-core/ui
parentfix(editorconfig-checker): update Windows assets (#904) (diff)
downloadmason-8529daa38242091d579ed24f28b35c8b80928e8a.tar
mason-8529daa38242091d579ed24f28b35c8b80928e8a.tar.gz
mason-8529daa38242091d579ed24f28b35c8b80928e8a.tar.bz2
mason-8529daa38242091d579ed24f28b35c8b80928e8a.tar.lz
mason-8529daa38242091d579ed24f28b35c8b80928e8a.tar.xz
mason-8529daa38242091d579ed24f28b35c8b80928e8a.tar.zst
mason-8529daa38242091d579ed24f28b35c8b80928e8a.zip
feat(ui): nicer bottom offset (#905)
This ensures that the window doesn't overlap the status bar.
Diffstat (limited to 'lua/mason-core/ui')
-rw-r--r--lua/mason-core/ui/display.lua6
1 files changed, 5 insertions, 1 deletions
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,