From 5347c83ee4cd445d6f97031a56fa4c8d36556475 Mon Sep 17 00:00:00 2001 From: olimorris Date: Wed, 26 Oct 2022 17:41:44 +0100 Subject: [PATCH] refactor!: warn of future branch_separator change --- lua/persisted/init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/persisted/init.lua b/lua/persisted/init.lua index c3c5661..be39af7 100644 --- a/lua/persisted/init.lua +++ b/lua/persisted/init.lua @@ -82,6 +82,16 @@ function M.setup(opts) config.setup(opts) setup_commands() + if 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 M.load() end