mirror of
https://github.com/folke/persistence.nvim.git
synced 2025-07-17 17:23:29 +02:00
fix: dont show errors when loading a session
This commit is contained in:
parent
251e89523d
commit
ad7fcd4fed
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ local e = vim.fn.fnameescape
|
||||||
function M.get_current()
|
function M.get_current()
|
||||||
local pattern = "/"
|
local pattern = "/"
|
||||||
if vim.fn.has("win32") == 1 then
|
if vim.fn.has("win32") == 1 then
|
||||||
pattern = '[\\:]'
|
pattern = "[\\:]"
|
||||||
end
|
end
|
||||||
local name = vim.fn.getcwd():gsub(pattern, "%%")
|
local name = vim.fn.getcwd():gsub(pattern, "%%")
|
||||||
return Config.options.dir .. name .. ".vim"
|
return Config.options.dir .. name .. ".vim"
|
||||||
|
@ -53,7 +53,7 @@ function M.load(opt)
|
||||||
opt = opt or {}
|
opt = opt or {}
|
||||||
local sfile = opt.last and M.get_last() or M.get_current()
|
local sfile = opt.last and M.get_last() or M.get_current()
|
||||||
if sfile and vim.fn.filereadable(sfile) ~= 0 then
|
if sfile and vim.fn.filereadable(sfile) ~= 0 then
|
||||||
vim.cmd("source " .. e(sfile))
|
vim.cmd("silent! source " .. e(sfile))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue