fix: do nothing when v:oldfiles are empty (#116)

This commit is contained in:
JINNOUCHI Yasushi 2023-08-09 09:31:10 +09:00 committed by GitHub
parent 54de6e45b9
commit 251fdb32d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,6 +60,9 @@ end
---@param paths string[]
---@return integer
function Database:insert_files(paths)
if #paths == 0 then
return 0
end
---@param path string
return self.sqlite.files:insert(vim.tbl_map(function(path)
return { path = path, count = 0 } -- TODO: remove when sql.nvim#97 is closed