From 542ba789c4f22cff92126715bfbcc4460af9e53e Mon Sep 17 00:00:00 2001 From: "Moh. Sulton Hasanuddin" Date: Fri, 12 Apr 2024 10:07:38 +0700 Subject: [PATCH] add zindex option for popup --- lua/telescope/actions/generate.lua | 1 + lua/telescope/actions/init.lua | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lua/telescope/actions/generate.lua b/lua/telescope/actions/generate.lua index 53a4ed7b3d..a557969550 100644 --- a/lua/telescope/actions/generate.lua +++ b/lua/telescope/actions/generate.lua @@ -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) diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua index a621a6f061..d0fa0f5e00 100644 --- a/lua/telescope/actions/init.lua +++ b/lua/telescope/actions/init.lua @@ -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 @@ -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)