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/actions/history.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lua/telescope/actions/history.lua') diff --git a/lua/telescope/actions/history.lua b/lua/telescope/actions/history.lua index c4eb8c8..8323ea7 100644 --- a/lua/telescope/actions/history.lua +++ b/lua/telescope/actions/history.lua @@ -1,5 +1,6 @@ local conf = require("telescope.config").values local Path = require "plenary.path" +local utils = require "telescope.utils" local uv = vim.loop @@ -111,10 +112,10 @@ end ---@return string: the next history item function histories.History:get_next(line, picker) if not self.enabled then - print( - "You are cycling to next the history item but history is disabled.", - "Read ':help telescope.defaults.history'" - ) + utils.notify("History:get_next", { + msg = "You are cycling to next the history item but history is disabled. Read ':help telescope.defaults.history'", + level = "WARN", + }) return false end if self._pre_get then @@ -136,10 +137,10 @@ end ---@return string: the previous history item function histories.History:get_prev(line, picker) if not self.enabled then - print( - "You are cycling to previous the history item but history is disabled.", - "Read ':help telescope.defaults.history'" - ) + utils.notify("History:get_prev", { + msg = "You are cycling to next the history item but history is disabled. Read ':help telescope.defaults.history'", + level = "WARN", + }) return false end if self._pre_get then -- cgit v1.2.3