zefei / vim-wintabs

Modern buffer manager for Vim
MIT License
325 stars 25 forks source link

Buffers do not get restored when nerd tree is open when saving the session, and the current working directory is `~` #38

Closed dylan-chong closed 6 years ago

dylan-chong commented 6 years ago

I don't have time to create a minimal vimrc file at the moment, I will try to get around to that sometime in the future (no guarantees when). But these are the replication steps:

  1. Open Vim in your home directory
  2. Open two files (i.e. buffers)
  3. Open nerd tree
  4. Save the session with vim-session
  5. Close Vim
  6. Reopen Vim. Only one of the two files is restored
zefei commented 6 years ago

I can repro, will try to fix. No need for minimal vimrc.

zefei commented 6 years ago

This looks like a special interaction between vim-session and Nerdtree. During the session load of Nerdtree, vim-session does some extra steps to restore Nerdtree, which in turn destroys the wintabs session. This wouldn't happen if you use :mksession and :so. So I'm afraid I can't fix this issue completely.

One way to mitigate the issue is that: when this happens, call :WintabsAllBuffers. This should be able to restore your buffers from last session.

zefei commented 6 years ago

I'm closing this since it cannot be fixed. vim-session does a lot of extra stuff with nerdtree and disrupts normal wintabs buffer restore.