folke / persistence.nvim

💾 Simple session management for Neovim
Apache License 2.0
591 stars 26 forks source link

bug: how to exclude the current directory (as empty buffer) on session restore #27

Closed xuanhung1509 closed 1 year ago

xuanhung1509 commented 1 year ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.9.0

Operating system/version

Linux Mint 21.1 Vera

Describe the bug

Suppose I have a single buffer image

However, on restore, it also creates an empty buffer for the directory, which is not what I expect (the buffer to the left of App.tsx) image image

I've tried to exclude "curdir" from options but it doesn't work either. Actually, even if I set options to nil, it still functions as default.

Steps To Reproduce

  1. Open and edit a file
  2. Save the file and quit
  3. Open and restore session

Expected Behavior

It should not create an empty buffer for current directory on restoring

Repro

No response

folke commented 1 year ago

Must be something in your config. Never heard anyone having such an issue before

medv commented 1 year ago

@xuanhung1509 did you ever track this down? I'll try to take a look otherwise since this happens to me, too.

xuanhung1509 commented 1 year ago

As far as I can tell, this has sth to do with the distro. The above issue exists in NvChad, but if I install onto LunarVim, it seems to work fine.

medv commented 1 year ago

It's present in Astronvim as well, so that's useful info. Thanks!

nickclyde commented 3 days ago

I am encountering this issue in LazyVim as well. I did switch from NeoTree to mini.files but other than that my config is pretty stock LazyVim. Driving myself crazy trying to figure out how to stop it!