fix: #107 corrected remove warning message
parent
9545fc0b85
commit
284d714b8d
|
|
@ -113,6 +113,15 @@ function M.get_branch(dir)
|
||||||
if vim.fn.filereadable(branch_session) ~= 0 then
|
if vim.fn.filereadable(branch_session) ~= 0 then
|
||||||
return branch
|
return branch
|
||||||
else
|
else
|
||||||
|
vim.api.nvim_echo({
|
||||||
|
{ "[Persisted.nvim]\n", "Question" },
|
||||||
|
{ "Could not load a session for branch " },
|
||||||
|
{ git_branch[1] .. "\n", "WarningMsg" },
|
||||||
|
{ "Trying to load a session for branch " },
|
||||||
|
{ config.options.default_branch, "Title" },
|
||||||
|
{ " ..." },
|
||||||
|
}, true, {})
|
||||||
|
|
||||||
vim.g.persisted_branch_session = branch_session
|
vim.g.persisted_branch_session = branch_session
|
||||||
return config.options.branch_separator .. config.options.default_branch
|
return config.options.branch_separator .. config.options.default_branch
|
||||||
end
|
end
|
||||||
|
|
@ -177,17 +186,6 @@ function M.load(opt, dir)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if session and not session_exists then
|
|
||||||
vim.api.nvim_echo({
|
|
||||||
{ "[Persisted.nvim]\n", "Question" },
|
|
||||||
{ "Could not find a session for " },
|
|
||||||
{ vim.fn.getcwd() .. "\n", "WarningMsg" },
|
|
||||||
{ "As per " },
|
|
||||||
{ "https://github.com/olimorris/persisted.nvim/discussions/103", "WarningMsg" },
|
|
||||||
{ " you may need to remove the branch from the name" },
|
|
||||||
}, true, {})
|
|
||||||
end
|
|
||||||
|
|
||||||
if config.options.autosave and (allow_dir(dir) and not ignore_dir(dir)) then
|
if config.options.autosave and (allow_dir(dir) and not ignore_dir(dir)) then
|
||||||
M.start()
|
M.start()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue