shallow copy when getting all bookmarks

This commit is contained in:
Diogo Duarte
2024-03-31 16:51:53 +01:00
parent 13bd26ea58
commit 950068ec64

View File

@@ -44,7 +44,11 @@ local save_bookmark = ya.sync(function(state, idx)
end)
local all_bookmarks = ya.sync(function(state, append_last_dir)
bookmarks = state.bookmarks or {}
local bookmarks = {}
for _, value in pairs(state.bookmarks) do
table.insert(bookmarks, value)
end
if append_last_dir and state.last_dir then
table.insert(bookmarks, state.last_dir)