Fixed issue where multiple bookmarks where being created for the same key
This commit is contained in:
9
init.lua
9
init.lua
@@ -18,7 +18,14 @@ local save_bookmark = ya.sync(function(state, idx)
|
|||||||
local folder = Folder:by_kind(Folder.CURRENT)
|
local folder = Folder:by_kind(Folder.CURRENT)
|
||||||
|
|
||||||
state.bookmarks = state.bookmarks or {}
|
state.bookmarks = state.bookmarks or {}
|
||||||
state.bookmarks[#state.bookmarks + 1] = {
|
state.indexes = state.indexes or {}
|
||||||
|
local _idx = state.indexes[idx]
|
||||||
|
if _idx == nil then
|
||||||
|
_idx = #state.bookmarks + 1
|
||||||
|
state.indexes[idx] = _idx
|
||||||
|
end
|
||||||
|
|
||||||
|
state.bookmarks[_idx] = {
|
||||||
on = SUPPORTED_KEYS[idx].on,
|
on = SUPPORTED_KEYS[idx].on,
|
||||||
desc = tostring(folder.cwd),
|
desc = tostring(folder.cwd),
|
||||||
cursor = folder.cursor,
|
cursor = folder.cursor,
|
||||||
|
|||||||
Reference in New Issue
Block a user