feat: show assigned function in actions.which_key (#1871)

This commit is contained in:
fdschmidt93
2022-04-22 15:52:22 +02:00
committed by GitHub
parent 92019d5053
commit d88094fbfd
3 changed files with 46 additions and 3 deletions

View File

@@ -477,14 +477,15 @@ end)
--- Telescope Wrapper around vim.notify
---@param funname string: name of the function that will be
---@param opts table: opts.level string, opts.msg string
---@param opts table: opts.level string, opts.msg string, opts.once bool
utils.notify = function(funname, opts)
opts.once = vim.F.if_nil(opts.once, false)
local level = vim.log.levels[opts.level]
if not level then
error("Invalid error level", 2)
end
vim.notify(string.format("[telescope.%s]: %s", funname, opts.msg), level, {
local notify_fn = opts.once and vim.notify_once or vim.notify
notify_fn(string.format("[telescope.%s]: %s", funname, opts.msg), level, {
title = "telescope.nvim",
})
end