Neovim plugin improving access to clipboard history (mirror)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(fixed issue populating bank with d register type)

+4 -4
+4 -4
lua/yankbank/clipboard.lua
··· 4 4 -- Function to add yanked text to table 5 5 function M.add_yank(yanks, text, max_entries) 6 6 -- avoid adding empty strings 7 - if text ~= "" and text ~= "\n" then 7 + if text ~= "" and text ~= " " and text ~= "\n" then 8 8 -- do not update with duplicate values 9 9 for _, entry in ipairs(yanks) do 10 10 if entry == text then ··· 35 35 if vim.v.event.regname == '' then 36 36 local yanked_text = vim.fn.getreg(rn) 37 37 38 - -- don't track single character deletions 39 - if #yanked_text <= 1 and reg_type ~= "y" then 40 - return 38 + -- NOTE: this only blocks adding to list if something else is in plus register 39 + if string.len(yanked_text) <= 1 then 40 + return 41 41 end 42 42 43 43 M.add_yank(yanks, yanked_text, max_entries)