From 7c70180b6375665adf13aa343654e0dc120e3988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Sat, 15 Jun 2024 15:30:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(nvim):=20yanky=20function=20?= =?UTF-8?q?to=20use=20a=20picker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lua/plugins/extras/coding/yanky-extended.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/extras/coding/yanky-extended.lua b/.config/nvim/lua/plugins/extras/coding/yanky-extended.lua index d0e50a2c..6fb33140 100644 --- a/.config/nvim/lua/plugins/extras/coding/yanky-extended.lua +++ b/.config/nvim/lua/plugins/extras/coding/yanky-extended.lua @@ -30,9 +30,20 @@ return { }, } end, - -- stylua: ignore keys = { - {"sy", function() require("telescope").extensions.yank_history.yank_history({}) end, mode = {"n", "v"}, desc = "Yank History"}, + { + "sy", + function() + local ok, telescope = pcall(require, "telescope") + if ok then + telescope.extensions.yank_history.yank_history({}) + else + vim.cmd([[YankyRingHistory]]) + end + end, + mode = { "n", "v" }, + desc = "Yank History", + }, }, }, }