summaryrefslogtreecommitdiff
path: root/lua/telescope/command.lua
diff options
context:
space:
mode:
authortami5 <kkharji@protonmail.com>2022-03-13 20:11:27 +0300
committerGitHub <noreply@github.com>2022-03-13 18:11:27 +0100
commitef7b6ada6d91a1b2932492d78c730e4fc00cd2ea (patch)
treedda4cb7cb3357724c83e85666bc8dc5c1ee2e898 /lua/telescope/command.lua
parent75b57304323861631519e204d9fbca7bdbf1c4c5 (diff)
feat: improve UX with vim.notify (#1763)
* fix(notify): don't report request on new line * ref(notify): update message format * ref(msgs): always quote values + decrease duplication * fix(ci): undefined variables * ref(actions): temporary silent actions.__index errors * cleanup * revert: panic effort, we continue to use error for those Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Diffstat (limited to 'lua/telescope/command.lua')
-rw-r--r--lua/telescope/command.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/lua/telescope/command.lua b/lua/telescope/command.lua
index 89ed426..4bf30d4 100644
--- a/lua/telescope/command.lua
+++ b/lua/telescope/command.lua
@@ -45,6 +45,7 @@ local themes = require "telescope.themes"
local builtin = require "telescope.builtin"
local extensions = require("telescope._extensions").manager
local config = require "telescope.config"
+local utils = require "telescope.utils"
local command = {}
local arg_value = {
@@ -119,7 +120,10 @@ command.convert_user_opts = function(user_opts)
local _switch_metatable = {
__index = function(_, k)
- print(string.format("Type of %s does not match", k))
+ utils.notify("command", {
+ msg = string.format("Type of '%s' does not match", k),
+ level = "WARN",
+ })
end,
}
@@ -153,7 +157,10 @@ end
local function run_command(args)
local user_opts = args or {}
if next(user_opts) == nil and not user_opts.cmd then
- print "[Telescope] your command miss args"
+ utils.notify("command", {
+ msg = "Command missing arguments",
+ level = "ERROR",
+ })
return
end
@@ -186,7 +193,10 @@ local function run_command(args)
return
end
- print "[Telescope] unknown command"
+ utils.notify("run_command", {
+ msg = "Unknown command",
+ level = "ERROR",
+ })
end
-- @Summary get extensions sub command