···24242525--- wrapper function for main plugin functionality
2626---@param opts table
2727---- TODO: read from persistent database if sql persist is set (allow multi-session sync)
2827local function show_yank_bank(opts)
2828+ yanks = persistence.get_yanks(opts) or yanks
2929+2930 -- initialize buffer and populate bank
3031 local bufnr, display_lines, line_yank_map =
3132 menu.create_and_fill_buffer(yanks, reg_types, opts)
+8
lua/yankbank/persistence.lua
···1212 end
1313end
14141515+--- get current state of yanks in persistent storage
1616+---@param opts table
1717+function M.get_yanks(opts)
1818+ if opts.persist_type == "sqlite" then
1919+ return persistence:get_bank()
2020+ end
2121+end
2222+1523---initialize bank persistence
1624---@param opts table
1725---@return table
-2
lua/yankbank/persistence/sql.lua
···8282 return yanks, reg_types
8383end
84848585--- FIX: correctly handle multiple sessions open at once
8686-8785--- set up database persistence
8886---@param opts table
8987---@return sqlite_tbl data