From ef7b6ada6d91a1b2932492d78c730e4fc00cd2ea Mon Sep 17 00:00:00 2001 From: tami5 Date: Sun, 13 Mar 2022 20:11:27 +0300 Subject: 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 --- lua/telescope/command.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lua/telescope/command.lua') 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 -- cgit v1.2.3