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>
This commit is contained in:
tami5
2022-03-13 20:11:27 +03:00
committed by GitHub
parent 75b5730432
commit ef7b6ada6d
17 changed files with 311 additions and 116 deletions

View File

@@ -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