Skip to content

Commit

Permalink
refactor: moved cmdline route setup to config.cmdline
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 27, 2022
1 parent 99bbfe7 commit 498a8b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 8 additions & 1 deletion lua/noice/config/cmdline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function M.setup()
local hl_group_border = "CmdlinePopupBorder" .. kind_cc
Highlights.add(hl_group_border, "DiagnosticSignInfo")

formats[name] = vim.tbl_deep_extend("force", {
format = vim.tbl_deep_extend("force", {
conceal = format.conceal ~= false,
kind = kind,
icon_hl_group = "Noice" .. hl_group_icon,
Expand All @@ -40,6 +40,13 @@ function M.setup()
},
},
}, { opts = vim.deepcopy(Config.options.cmdline.opts) }, format)
formats[name] = format

table.insert(Config.options.routes, {
view = format.view,
opts = format.opts,
filter = { event = "cmdline", kind = format.kind },
})
end
end
end
Expand Down
8 changes: 0 additions & 8 deletions lua/noice/config/routes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ function M.defaults()
---@type NoiceRouteConfig[]
local ret = {}

for _, format in pairs(Config.options.cmdline.format) do
table.insert(ret, {
view = format.view,
opts = format.opts,
filter = { event = "cmdline", kind = format.kind },
})
end

for _, kind in ipairs({ "signature", "hover" }) do
table.insert(ret, {
view = Config.options.lsp[kind].view or Config.options.lsp.documentation.view,
Expand Down

0 comments on commit 498a8b3

Please sign in to comment.