Skip to content

Commit

Permalink
perf(yanky): schedule_wrap sqlite push to history to prevent blocki…
Browse files Browse the repository at this point in the history
…ng Neovim on copy/paste
  • Loading branch information
folke committed May 15, 2024
1 parent 3c04789 commit 9047d04
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/lazyvim/plugins/extras/coding/yanky.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ return {
"gbprod/yanky.nvim",
dependencies = not LazyVim.is_win() and { "kkharji/sqlite.lua" } or {},
opts = {
highlight = { timer = 250 },
highlight = { timer = 150 },
ring = { storage = LazyVim.is_win() and "shada" or "sqlite" },
},
keys = {
Expand All @@ -28,5 +28,11 @@ return {
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
},
config = function(_, opts)
require("yanky").setup(opts)
local sqlite = require("yanky.storage.sqlite")
local push = sqlite.push
sqlite.push = vim.schedule_wrap(push)
end,
},
}

0 comments on commit 9047d04

Please sign in to comment.