Skip to content

feat: popup and border zindex #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions POPUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ this and expose the API in vimL to create better compatibility.

## List of Neovim Features Required:

- [ ] Add Z-index for floating windows
- [ ] When complete, we can add `zindex` parameter
- [ ] Key handlers (used for `popup_filter`)
- [ ] scrollbar for floating windows
- [ ] scrollbar
Expand Down Expand Up @@ -69,6 +67,7 @@ Suported Features:
- [x] time
- [x] title
- [x] wrap
- [x] zindex

## All known unimplemented vim features at the moment

Expand Down
6 changes: 6 additions & 0 deletions lua/plenary/popup/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function popup.create(what, vim_options)

local option_defaults = {
posinvert = true,
zindex = 50,
}

local win_opts = {}
Expand Down Expand Up @@ -198,6 +199,11 @@ function popup.create(what, vim_options)
-- textpropwin
-- textpropid

-- zindex, Priority for the popup, default 50. Minimum value is
-- , 1, maximum value is 32000.
local zindex = dict_default(vim_options, "zindex", option_defaults)
win_opts.zindex = utils.bounded(zindex, 1, 32000)

-- noautocmd, undocumented vim default per https://github.com/vim/vim/issues/5737
win_opts.noautocmd = vim.F.if_nil(vim_options.noautocmd, true)

Expand Down
1 change: 1 addition & 0 deletions lua/plenary/window/border.lua
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ function Border:new(content_bufnr, content_win_id, content_win_options, border_w
col = content_win_options.col - thickness.left,
width = content_win_options.width + thickness.left + thickness.right,
height = content_win_options.height + thickness.top + thickness.bot,
zindex = content_win_options.zindex or 50,
noautocmd = content_win_options.noautocmd,
})

Expand Down