Skip to content

Commit

Permalink
feat(msg): added support for msg_show list_cmd and input_prompt kinds
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 22, 2024
1 parent e0fd746 commit 21fe733
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 2 additions & 5 deletions lua/noice/config/routes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ function M.defaults()
any = {
{ event = "msg_show", kind = "confirm" },
{ event = "msg_show", kind = "confirm_sub" },
-- { event = "msg_show", kind = { "echo", "echomsg", "" }, before = true },
-- { event = "msg_show", kind = { "echo", "echomsg" }, instant = true },
-- { event = "msg_show", find = "E325" },
-- { event = "msg_show", find = "Found a swap file" },
{ event = "msg_show", kind = "number_prompt" },
},
},
},
Expand Down Expand Up @@ -83,7 +80,7 @@ function M.defaults()
view = Config.options.messages.view,
filter = {
event = "msg_show",
kind = { "", "echo", "echomsg", "lua_print" },
kind = { "", "echo", "echomsg", "lua_print", "list_cmd" },
},
opts = { replace = true, merge = true, title = "Messages" },
},
Expand Down
4 changes: 3 additions & 1 deletion lua/noice/ui/msg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ M.kinds = {
-- input related
confirm = "confirm", -- |confirm()| or |:confirm| dialog
confirm_sub = "confirm_sub", -- |:substitute| confirm dialog |:s_c|
number_prompt = "number_prompt", -- |inputlist()| prompt for a number
return_prompt = "return_prompt", -- |press-enter| prompt after a multiple messages
list_cmd = "list_cmd", -- |:list| command
-- error/warnings
emsg = "emsg", -- Error (|errors|, internal error, |:throw|, …)
echoerr = "echoerr", -- |:echoerr| message
Expand Down Expand Up @@ -83,7 +85,7 @@ end
function M.on_show(event, kind, content, replace_last)
if kind == M.kinds.return_prompt then
return M.on_return_prompt()
elseif kind == M.kinds.confirm or kind == M.kinds.confirm_sub then
elseif kind == M.kinds.confirm or kind == M.kinds.confirm_sub or kind == M.kinds.number_prompt then
return M.on_confirm(event, kind, content)
end

Expand Down

0 comments on commit 21fe733

Please sign in to comment.