···99---@return boolean
1010local function file_exists(file)
1111 local f = io.open(file, "rb")
1212- if f then f:close() end
1212+ if f then
1313+ f:close()
1414+ end
1315 return f ~= nil
1416end
1517···1719---@param file string: file path
1820---@return table
1921local function read_lines(file)
2020- if not file_exists(file) then return {} end
2222+ if not file_exists(file) then
2323+ return {}
2424+ end
2125 local lines = {}
2226 for line in io.lines(file) do
2323- lines[#lines+1] = line
2727+ lines[#lines + 1] = line
2428 end
2529 return lines
2630end
···4347---@param line string: line from file being checked
4448---@return table|nil
4549local function check_for_entry(line)
4646- local i, l, ft, rt = string.match(line, "<YANKBANK_ENTRY:(%d+),(%d+),(%a+),(%a+)>")
5050+ local i, l, ft, rt =
5151+ string.match(line, "<YANKBANK_ENTRY:(%d+),(%d+),(%a+),(%a+)>")
4752 if i then
4853 return {
4954 index = tonumber(i),
···134139print(M.setup_persistence(yanks, "test.txt", 10))
135140yanks = {}
136141print(M.setup_persistence(yanks, "test1.txt", 10))
137137-142142+print(n_entries)
138143139144return M