Skip to content

Commit

Permalink
feat(popupmenu): allow different views for regular/cmdline popupmenu
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 6, 2023
1 parent f5c0ccc commit af706c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lua/noice/config/views.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ M.defaults = {
padding = { 0, 1 },
},
},
cmdline_popupmenu = {
view = "popupmenu",
},
virtualtext = {
backend = "virtualtext",
format = { "{message}" },
Expand Down
4 changes: 3 additions & 1 deletion lua/noice/ui/popupmenu/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ end
function M.opts(state)
local is_cmdline = state.grid == -1

local _opts = vim.deepcopy(Config.options.views.popupmenu or {})
local view = require("noice.config.views").get_options(is_cmdline and "cmdline_popupmenu" or "popupmenu")

local _opts = vim.deepcopy(view or {})
_opts.enter = false
_opts.type = "popup"

Expand Down

0 comments on commit af706c4

Please sign in to comment.