Remove deprecated code
This commit is contained in:
10
README.md
10
README.md
@@ -55,7 +55,6 @@ The following are the default configurations:
|
|||||||
```lua
|
```lua
|
||||||
-- ~/.config/yazi/init.lua
|
-- ~/.config/yazi/init.lua
|
||||||
require("bookmarks"):setup({
|
require("bookmarks"):setup({
|
||||||
save_last_directory = false, -- DEPRECATED - will be removed in the future. Use `last_directory`
|
|
||||||
last_directory = { enable = false, persist = false },
|
last_directory = { enable = false, persist = false },
|
||||||
persist = "none",
|
persist = "none",
|
||||||
desc_format = "full",
|
desc_format = "full",
|
||||||
@@ -72,13 +71,6 @@ require("bookmarks"):setup({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
### `save_last_directory`
|
|
||||||
|
|
||||||
When enabled, a new bookmark is automatically created in `'` which allows the user to jump back to
|
|
||||||
the last directory.
|
|
||||||
|
|
||||||
***NOTE:*** This option is **DEPRECATED** and will be removed in the future in favor of `last_directory`.
|
|
||||||
|
|
||||||
### `last_directory`
|
### `last_directory`
|
||||||
|
|
||||||
When enabled, a new bookmark is automatically created in `'` which allows the user to jump back to
|
When enabled, a new bookmark is automatically created in `'` which allows the user to jump back to
|
||||||
@@ -117,7 +109,7 @@ The mode for choosing which directory to bookmark.
|
|||||||
There are two possible values for this option:
|
There are two possible values for this option:
|
||||||
|
|
||||||
| Value | Description |
|
| Value | Description |
|
||||||
| -------- | ----------------------------------------------------------------------------------------------- |
|
| -------- | ------------------------------------------------------------------- |
|
||||||
| `hover` | The default, it uses the path of the hovered file for new bookmarks |
|
| `hover` | The default, it uses the path of the hovered file for new bookmarks |
|
||||||
| `parent` | Uses the path of the parent folder for new bookmarks |
|
| `parent` | Uses the path of the parent folder for new bookmarks |
|
||||||
|
|
||||||
|
|||||||
12
init.lua
12
init.lua
@@ -216,11 +216,8 @@ local delete_all_bookmarks = ya.sync(function(state)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
entry = function(_, job_or_args)
|
entry = function(_, job)
|
||||||
-- TODO: DEPRECATE IN Yazi 0.4
|
local action = job.args[1]
|
||||||
-- https://github.com/sxyazi/yazi/pull/1966
|
|
||||||
local args = job_or_args.args or job_or_args
|
|
||||||
local action = args[1]
|
|
||||||
if not action then
|
if not action then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -258,10 +255,7 @@ return {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO: DEPRECATED Yazi 0.4
|
if type(args.last_directory) == "table" then
|
||||||
if args.save_last_directory then
|
|
||||||
_save_last_directory()
|
|
||||||
elseif type(args.last_directory) == "table" then
|
|
||||||
if args.last_directory.enable then
|
if args.last_directory.enable then
|
||||||
_save_last_directory(args.last_directory.persist)
|
_save_last_directory(args.last_directory.persist)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user