Skip to content
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

add zindex option for popup action.which_key #3046

Merged
merged 1 commit into from
Apr 15, 2024
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
1 change: 1 addition & 0 deletions lua/telescope/actions/generate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ local action_generate = {}
---@field normal_hl string: winhl of "Normal" for keymap hints floating window (default: "TelescopePrompt")
---@field border_hl string: winhl of "Normal" for keymap borders (default: "TelescopePromptBorder")
---@field winblend number: pseudo-transparency of keymap hints floating window
---@field zindex number: z-index of keymap hints floating window (default: 100)
action_generate.which_key = function(opts)
local which_key = function(prompt_bufnr)
actions.which_key(prompt_bufnr, opts)
Expand Down
2 changes: 2 additions & 0 deletions lua/telescope/actions/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,7 @@ actions.which_key = function(prompt_bufnr, opts)
if type(opts.winblend) == "function" then
opts.winblend = opts.winblend()
end
opts.zindex = vim.F.if_nil(opts.zindex, 100)
opts.column_padding = vim.F.if_nil(opts.column_padding, " ")

-- Assigning into 'opts.column_indent' would override a number with a string and
Expand Down Expand Up @@ -1363,6 +1364,7 @@ actions.which_key = function(prompt_bufnr, opts)
borderchars = { prompt_pos and "─" or " ", "", not prompt_pos and "─" or " ", "", "", "", "", "" },
noautocmd = true,
title = { { text = title_text, pos = prompt_pos and "N" or "S" } },
zindex = opts.zindex,
}
local km_win_id, km_opts = popup.create("", popup_opts)
local km_buf = a.nvim_win_get_buf(km_win_id)
Expand Down
Loading