Skip to content

Commit d6864ff

Browse files
authored
feat: popup and border zindex (#215)
1 parent f1c783e commit d6864ff

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

POPUP.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ this and expose the API in vimL to create better compatibility.
1414

1515
## List of Neovim Features Required:
1616

17-
- [ ] Add Z-index for floating windows
18-
- [ ] When complete, we can add `zindex` parameter
1917
- [ ] Key handlers (used for `popup_filter`)
2018
- [ ] scrollbar for floating windows
2119
- [ ] scrollbar
@@ -69,6 +67,7 @@ Suported Features:
6967
- [x] time
7068
- [x] title
7169
- [x] wrap
70+
- [x] zindex
7271

7372
## All known unimplemented vim features at the moment
7473

lua/plenary/popup/init.lua

+6
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ function popup.create(what, vim_options)
9292

9393
local option_defaults = {
9494
posinvert = true,
95+
zindex = 50,
9596
}
9697

9798
local win_opts = {}
@@ -198,6 +199,11 @@ function popup.create(what, vim_options)
198199
-- textpropwin
199200
-- textpropid
200201

202+
-- zindex, Priority for the popup, default 50. Minimum value is
203+
-- , 1, maximum value is 32000.
204+
local zindex = dict_default(vim_options, "zindex", option_defaults)
205+
win_opts.zindex = utils.bounded(zindex, 1, 32000)
206+
201207
-- noautocmd, undocumented vim default per https://github.com/vim/vim/issues/5737
202208
win_opts.noautocmd = vim.F.if_nil(vim_options.noautocmd, true)
203209

lua/plenary/window/border.lua

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ function Border:new(content_bufnr, content_win_id, content_win_options, border_w
188188
col = content_win_options.col - thickness.left,
189189
width = content_win_options.width + thickness.left + thickness.right,
190190
height = content_win_options.height + thickness.top + thickness.bot,
191+
zindex = content_win_options.zindex or 50,
191192
noautocmd = content_win_options.noautocmd,
192193
focusable = vim.F.if_nil(border_win_options.focusable, false),
193194
})

0 commit comments

Comments
 (0)