From 1d323bfcc3c94f50436f9479bb2a07b73a36856c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 26 Feb 2024 20:42:21 +0800 Subject: [PATCH] perf(neoyank): use notify api --- lua/telescope/_extensions/neoyank.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/telescope/_extensions/neoyank.lua b/lua/telescope/_extensions/neoyank.lua index e5db61f17..ab3208bc6 100644 --- a/lua/telescope/_extensions/neoyank.lua +++ b/lua/telescope/_extensions/neoyank.lua @@ -4,6 +4,7 @@ local conf = require("telescope.config").values local entry_display = require("telescope.pickers.entry_display") local finders = require("telescope.finders") local pickers = require("telescope.pickers") +local notify = require('spacevim.api.notify') local function prepare_neoyank_output(register) local lines = {} @@ -54,9 +55,7 @@ local function show_yank_history(opts) vim.fn.setreg('"', entry.value[1]) local ok, rst = pcall(vim.cmd, 'normal! p') if not ok then - vim.g._spacevim_temp_err = rst - -- @todo implement lua notify api - local notify = vim.api.nvim_eval('SpaceVim#api#notify#get().notify(g:_spacevim_temp_err, "WarningMsg")') + notify.notify(rst, 'WarningMsg') end vim.fn.setreg('"', reg) end)