From 5116df5e954c0e810da789ba73916fee8b4a276f Mon Sep 17 00:00:00 2001 From: Diogo Duarte Date: Mon, 6 Jan 2025 11:48:18 +0000 Subject: [PATCH] Remove deprecated code --- README.md | 16 ++++------------ init.lua | 12 +++--------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 06c7658..f7f1290 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,6 @@ The following are the default configurations: ```lua -- ~/.config/yazi/init.lua require("bookmarks"):setup({ - save_last_directory = false, -- DEPRECATED - will be removed in the future. Use `last_directory` last_directory = { enable = false, persist = false }, persist = "none", 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` When enabled, a new bookmark is automatically created in `'` which allows the user to jump back to @@ -116,10 +108,10 @@ The mode for choosing which directory to bookmark. There are two possible values for this option: -| Value | Description | -| -------- | ----------------------------------------------------------------------------------------------- | -| `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 | +| Value | Description | +| -------- | ------------------------------------------------------------------- | +| `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 | ### `notify` diff --git a/init.lua b/init.lua index be789c9..f8c97f8 100644 --- a/init.lua +++ b/init.lua @@ -216,11 +216,8 @@ local delete_all_bookmarks = ya.sync(function(state) end) return { - entry = function(_, job_or_args) - -- TODO: DEPRECATE IN Yazi 0.4 - -- https://github.com/sxyazi/yazi/pull/1966 - local args = job_or_args.args or job_or_args - local action = args[1] + entry = function(_, job) + local action = job.args[1] if not action then return end @@ -258,10 +255,7 @@ return { return end - -- TODO: DEPRECATED Yazi 0.4 - if args.save_last_directory then - _save_last_directory() - elseif type(args.last_directory) == "table" then + if type(args.last_directory) == "table" then if args.last_directory.enable then _save_last_directory(args.last_directory.persist) end