folke / persistence.nvim

💾 Simple session management for Neovim
Apache License 2.0
655 stars 25 forks source link

bug: session corrupts weirdly (LazyVim) #29

Closed REmerald closed 1 year ago

REmerald commented 1 year ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.10.0-dev-546+g3bf887f6e

Operating system/version

Arch Linux

Describe the bug

Weird phantom empty buffer appears (partially copying the name of the other buffer) after restoring the session: image

UPD: Happens after 2nd restart (after deleting sessions/*) if displayed buffer was not the last one in bufferline.

Steps To Reproduce

  1. rm -rf .local/state/lazyvim/sessions/*
  2. Launch LazyVim, open the buffers.
  3. Close LazyVim.
  4. Open Lazyvim, restore session with require("persistence").load({ last = true }); everything is ok no matter what buffer was on the screen prior to closing.
  5. Restart LazyVim; if the last buffer was opened, everything ok, if not, the phantom copy of the next buffer in bufferline will be added. (Buffer /home/remorin/Documents/program_in_C/practice/lettersum/object.c will be duplicated to /home/remorin/Documents/program_in_C/practice/lettersum/lettersum/object.c.)

Expected Behavior

Everything should be restored as if the last buffer in bufferline was selected.

Repro

-- Just install LazyVim under NVIM_APPNAME=lazyvim
-- See persistence.nvim configuration here: https://www.lazyvim.org/plugins/util#persistencenvim
folke commented 1 year ago

persistence uses just NEovim sessions under the hood.

It may be that your session file is corrupted. Delete it and it'll probably work againm.

HarunKilic commented 1 year ago

Have the same issue using LazyVim on Windows 11. Tried to delete session folder, but still same issue.

frogiraffe commented 11 months ago

yeah having the same issue, it adds the same file to session like this

badd +1 chiki/plugins/autoformat.lua
badd +1 chiki/autocmd.lua
badd +1 ~/.config/nvim/chiki/plugins/autoformat.lua

Not sure what causes it to be fair... couldn't find a issue under neovim repo either