diff options
| author | William Boman <william@redwill.se> | 2023-01-14 12:59:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-14 11:59:00 +0000 |
| commit | 8529daa38242091d579ed24f28b35c8b80928e8a (patch) | |
| tree | 93c3af27dd1c798ec84cdd34ebb3951b7ac276d0 /lua | |
| parent | fix(editorconfig-checker): update Windows assets (#904) (diff) | |
| download | mason-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')
| -rw-r--r-- | lua/mason-core/ui/display.lua | 6 |
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, |
