olimorris / persisted.nvim

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

[Bug]: sessions dir is empty and nothing opened when :SessionLoad #59

Closed ruanyouxing closed 1 year ago

ruanyouxing commented 1 year ago

Your Persisted.nvim config

  require('persisted').setup {
    save_dir = vim.fn.expand(vim.fn.stdpath 'data' .. '/sessions/'),
    autosave = true,
    should_autosave = function()
      vim.notify 'Session saved'
    end,
    telescope = {
      reset_prompt_after_deletion = true,
    },
  }

Error messages

No response

Describe the bug

What I expected to be happended

It will pump up my saved session when I use :SessionLoad or :SessionLoadLast or :Telescope persisted

What actually happended

Nothing, I checked the session directory and it's completely empty
image

Reproduce the bug

  1. run :SessionSave
  2. Reopen neovim
  3. run :SessionLoad (or :SessionLoadLast)
  4. nothing opened

Final checks

olimorris commented 1 year ago

should_autosave should return a boolean

ruanyouxing commented 1 year ago

Really? lol Thanks a lot

olimorris commented 1 year ago

@ruanyouxing the example in the readme gives a clear example.

If you wish to do any notifying after the session loads I'd recommend the callbacks section.