olimorris / persisted.nvim

💾 Simple session management for Neovim with git branching, autoloading and Telescope support
MIT License
437 stars 26 forks source link

Session Loading Issues #15

Closed calebdw closed 2 years ago

calebdw commented 2 years ago

Hello!

I ran a PackerSync and now or some reason I keep getting the below error when trying to reinstate a session:

[persisted.nvim]: Error loading the session! Vim(normal):E19: Mark has invalid line number

or sometimes I don't get the error but all I get are blank windows where my files used to be.

calebdw commented 2 years ago

On further inspection, it also looks like a blank buffer is being added sometimes as well: image

olimorris commented 2 years ago

Thanks for flagging! I think this was due to an update some commits ago. Can you check and see if the latest commit resolves this?

calebdw commented 2 years ago

Unfortunately that did not seem to help...

olimorris commented 2 years ago

Can you run nvim --clean -u minimal.lua with this:

-- minimal.lua file

-- ignore default config and plugins
vim.opt.runtimepath:remove(vim.fn.expand("~/.config/nvim"))
vim.opt.packpath:remove(vim.fn.expand("~/.local/share/nvim/site"))

-- append test directory
local test_dir = "/tmp/persisted"
vim.opt.runtimepath:append(vim.fn.expand(test_dir))
vim.opt.packpath:append(vim.fn.expand(test_dir))

-- install packer
local install_path = test_dir .. "/pack/packer/start/packer.nvim"
local install_plugins = false

if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
    vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
    vim.cmd("packadd packer.nvim")
    install_plugins = true
end

local packer = require("packer")

packer.init({
    package_root = test_dir .. "/pack",
    compile_path = test_dir .. "/plugin/packer_compiled.lua",
})

packer.startup(function(use)
    -- Packer can manage itself
    use("wbthomason/packer.nvim")
    use({
      "nvim-telescope/telescope.nvim",
      requires = { 'nvim-lua/plenary.nvim' }
    })
    use("olimorris/persisted.nvim")

    if install_plugins then
        packer.sync()
    end
end)

local ok, persisted = pcall(require, "persisted")
if ok then
    persisted.setup()
    require("telescope").load_extension("persisted")
end
calebdw commented 2 years ago

Hmm, I seem to get this error: image

olimorris commented 2 years ago

Could you try pairing your config back to minimal plugins. I have no idea what's causing it as the error messages aren't detailed enough. It could be another plugin that got updated that is causing the issue

olimorris commented 2 years ago

Just googling this...I think it might be a weird Vim error. If you google "E19: Mark has invalid line number" there is some odd results.

calebdw commented 2 years ago

Closing because it looks like a bug introduced in Neovim (I updated again and persisted seems to be working, although universal-tags and my lsp server keeps crashing....but that's another problem haha).

Thanks for your help!