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

Configure Feed

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

feat: correctly handle multiple simultaneous sessions with db

ptdewey cf069624 59cd263f

+10 -3
+2 -1
lua/yankbank/init.lua
··· 24 24 25 25 --- wrapper function for main plugin functionality 26 26 ---@param opts table 27 - --- TODO: read from persistent database if sql persist is set (allow multi-session sync) 28 27 local function show_yank_bank(opts) 28 + yanks = persistence.get_yanks(opts) or yanks 29 + 29 30 -- initialize buffer and populate bank 30 31 local bufnr, display_lines, line_yank_map = 31 32 menu.create_and_fill_buffer(yanks, reg_types, opts)
+8
lua/yankbank/persistence.lua
··· 12 12 end 13 13 end 14 14 15 + --- get current state of yanks in persistent storage 16 + ---@param opts table 17 + function M.get_yanks(opts) 18 + if opts.persist_type == "sqlite" then 19 + return persistence:get_bank() 20 + end 21 + end 22 + 15 23 ---initialize bank persistence 16 24 ---@param opts table 17 25 ---@return table
-2
lua/yankbank/persistence/sql.lua
··· 82 82 return yanks, reg_types 83 83 end 84 84 85 - -- FIX: correctly handle multiple sessions open at once 86 - 87 85 --- set up database persistence 88 86 ---@param opts table 89 87 ---@return sqlite_tbl data