summaryrefslogtreecommitdiff
path: root/lua/telescope/utils.lua
diff options
context:
space:
mode:
authorfdschmidt93 <39233597+fdschmidt93@users.noreply.github.com>2022-04-22 15:52:22 +0200
committerGitHub <noreply@github.com>2022-04-22 15:52:22 +0200
commitd88094fbfd84b297178252230f6faf0e7d2f7650 (patch)
tree2fb0d028d6fa42f990263052524cbd335b9a8d60 /lua/telescope/utils.lua
parent92019d5053674676576b021904935d101b059fd5 (diff)
feat: show assigned function in actions.which_key (#1871)
Diffstat (limited to 'lua/telescope/utils.lua')
-rw-r--r--lua/telescope/utils.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/lua/telescope/utils.lua b/lua/telescope/utils.lua
index d4922f2..46eee27 100644
--- a/lua/telescope/utils.lua
+++ b/lua/telescope/utils.lua
@@ -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