Updating state.curr_dir on hover + added initial state to it
This commit is contained in:
11
init.lua
11
init.lua
@@ -81,6 +81,12 @@ local delete_all_bookmarks = ya.sync(function(state)
|
||||
end)
|
||||
|
||||
local _save_last_dir = ya.sync(function(state)
|
||||
state.curr_dir = {
|
||||
on = "'",
|
||||
desc = "~", -- FIX This might not be true, i.e. the user entry point might not be the home dir
|
||||
cursor = 0,
|
||||
}
|
||||
|
||||
ps.sub("cd", function()
|
||||
local folder = Folder:by_kind(Folder.CURRENT)
|
||||
state.last_dir = state.curr_dir
|
||||
@@ -90,6 +96,11 @@ local _save_last_dir = ya.sync(function(state)
|
||||
cursor = folder.cursor,
|
||||
}
|
||||
end)
|
||||
|
||||
ps.sub("hover", function()
|
||||
local folder = Folder:by_kind(Folder.CURRENT)
|
||||
state.curr_dir.cursor = folder.cursor
|
||||
end)
|
||||
end)
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user