Add argument for enabling save_last_directory
This commit is contained in:
12
init.lua
12
init.lua
@@ -46,8 +46,10 @@ end)
|
|||||||
local all_bookmarks = ya.sync(function(state, append_last_dir)
|
local all_bookmarks = ya.sync(function(state, append_last_dir)
|
||||||
local bookmarks = {}
|
local bookmarks = {}
|
||||||
|
|
||||||
for _, value in pairs(state.bookmarks) do
|
if state.bookmarks then
|
||||||
table.insert(bookmarks, value)
|
for _, value in pairs(state.bookmarks) do
|
||||||
|
table.insert(bookmarks, value)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if append_last_dir and state.last_dir then
|
if append_last_dir and state.last_dir then
|
||||||
@@ -84,7 +86,7 @@ local delete_all_bookmarks = ya.sync(function(state)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local _save_last_dir = ya.sync(function(state)
|
local _save_last_directory = ya.sync(function(state)
|
||||||
state.curr_dir = {
|
state.curr_dir = {
|
||||||
on = "'",
|
on = "'",
|
||||||
desc = "~", -- FIX This might not be true, i.e. the user entry point might not be the home dir
|
desc = "~", -- FIX This might not be true, i.e. the user entry point might not be the home dir
|
||||||
@@ -145,7 +147,9 @@ return {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
_save_last_dir()
|
if args.save_last_directory then
|
||||||
|
_save_last_directory()
|
||||||
|
end
|
||||||
|
|
||||||
state.notify = {
|
state.notify = {
|
||||||
enable = false,
|
enable = false,
|
||||||
|
|||||||
Reference in New Issue
Block a user