refactor!: change default branch separator

main
olimorris 2022-11-02 17:38:41 +00:00
parent 2e61c9fb92
commit e39170f571
3 changed files with 2 additions and 12 deletions

View File

@ -129,7 +129,7 @@ require("persisted").setup({
command = "VimLeavePre", -- the autocommand for which the session is saved command = "VimLeavePre", -- the autocommand for which the session is saved
silent = false, -- silent nvim message when sourcing session file silent = false, -- silent nvim message when sourcing session file
use_git_branch = false, -- create session files based on the branch of the git enabled repository use_git_branch = false, -- create session files based on the branch of the git enabled repository
branch_separator = "_", -- string used to separate session directory name from branch name branch_separator = "@@", -- string used to separate session directory name from branch name
autosave = true, -- automatically save session files when exiting Neovim autosave = true, -- automatically save session files when exiting Neovim
should_autosave = nil, -- function to determine if a session should be autosaved should_autosave = nil, -- function to determine if a session should be autosaved
autoload = false, -- automatically load the session for the cwd on Neovim startup autoload = false, -- automatically load the session for the cwd on Neovim startup

View File

@ -6,7 +6,7 @@ local defaults = {
command = "VimLeavePre", -- the autocommand for which the session is saved command = "VimLeavePre", -- the autocommand for which the session is saved
silent = false, -- silent nvim message when sourcing session file silent = false, -- silent nvim message when sourcing session file
use_git_branch = false, -- create session files based on the branch of the git enabled repository use_git_branch = false, -- create session files based on the branch of the git enabled repository
branch_separator = "_", -- string used to separate session directory name from branch name branch_separator = "@@", -- string used to separate session directory name from branch name
autosave = true, -- automatically save session files when exiting Neovim autosave = true, -- automatically save session files when exiting Neovim
should_autosave = nil, -- function to determine if a session should be autosaved should_autosave = nil, -- function to determine if a session should be autosaved
autoload = false, -- automatically load the session for the cwd on Neovim startup autoload = false, -- automatically load the session for the cwd on Neovim startup

View File

@ -82,16 +82,6 @@ function M.setup(opts)
config.setup(opts) config.setup(opts)
setup_commands() setup_commands()
if opts and not opts.branch_separator and config.options.branch_separator == "_" then
vim.notify(
"[Persisted.nvim] We will soon be changing the default `branch_separator` config value to `@@`\n" ..
"[Persisted.nvim] We notice you're using the current default value of `_`\n" ..
"[Persisted.nvim] To continue using this, please add `branch_separator = \"_\"` to your config and we'll quit bugging you\n" ..
"[Persisted.nvim] Otherwise, please replace the `_` in your session names with `@@`",
vim.log.levels.WARN
)
end
if config.options.autoload and (allow_dir() and not ignore_dir()) and vim.fn.argc() == 0 then if config.options.autoload and (allow_dir() and not ignore_dir()) and vim.fn.argc() == 0 then
M.load() M.load()
end end