From 6c3f197d675a87ab7d91984f418d50706da4012c Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:49:16 +0800 Subject: [PATCH] feat(persisted): update for recent code rewrite (#1338) Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/configs/editor/persisted.lua | 26 ++++++++---------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/lua/modules/configs/editor/persisted.lua b/lua/modules/configs/editor/persisted.lua index 003d8cb9d..2f1f43492 100644 --- a/lua/modules/configs/editor/persisted.lua +++ b/lua/modules/configs/editor/persisted.lua @@ -1,23 +1,13 @@ return function() require("modules.utils").load_plugin("persisted", { - save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"), -- directory where session files are saved - silent = false, -- silent nvim message when sourcing session file - use_git_branch = true, -- create session files based on the branch of the git enabled repository - autosave = true, -- automatically save session files when exiting Neovim - should_autosave = function() - if vim.bo.filetype == "alpha" then - return false - end - return true - end, -- function to determine if a session should be autosaved + save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"), + autostart = true, -- Set `lazy = false` in `plugins/editor.lua` to enable this - autoload = false, -- automatically load the session for the cwd on Neovim startup - on_autoload_no_session = nil, -- function to run when `autoload = true` but there is no session to load - follow_cwd = true, -- change session file name to match current working directory if it changes - allowed_dirs = nil, -- table of dirs that the plugin will auto-save and auto-load from - ignored_dirs = nil, -- table of dirs that are ignored when auto-saving and auto-loading - telescope = { -- options for the telescope extension - reset_prompt_after_deletion = true, -- whether to reset prompt after session deleted - }, + autoload = false, + follow_cwd = true, + use_git_branch = true, + should_save = function() + return vim.bo.filetype == "alpha" and false or true + end, }) end