Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

vim-nerdtree-tabs breaks :mksession #65

Open
matjon opened this issue Jan 20, 2015 · 4 comments
Open

vim-nerdtree-tabs breaks :mksession #65

matjon opened this issue Jan 20, 2015 · 4 comments

Comments

@matjon
Copy link

matjon commented Jan 20, 2015

Hello,
When I have NERDTreeTabs open and I save a session (through :mksession or :SessionSave from vim-session) and then I try to restore it, strange things happen.

Steps to reproduce:

  1. Open some files in vim:

    vim -p file.txt nohup.out .xsession-errors

  2. Make sure NERDTreeTabs is open.

  3. Execute :mksession /tmp/ses.vim

  4. Close vim.

  5. Open vim again.

  6. :source /tmp/ses.vim

I get the following errors (I have translated the error messages manually):

    "file.txt" 14L, 625C
    "file.txt" 14L, 625C
    Detected an error while processing /tmp/ses.vim:
    line   34:
    E95: Buffer with this name exists
    "nohup.out" 1L, 36C
    ".xsession-errors" 8244L, 683168C
    ".xsession-errors" 8244 lines --0%-- (2 of 3)
    line 58:
    E95: Buffer with this name exists
    ".xsession-errors" 8248L, 683644C
    "nohup.out" 1L, 36C
    "nohup.out" 1 line --100%-- (3 of 3)
    line   82:
    E95: Buffer with this name exists

and I have an additional buffer on every tab.

@matjon
Copy link
Author

matjon commented Jan 20, 2015

This is probably caused by the fact that all NERDTree windows have the same name "NERD_tree_1". That name apperas in session.vim multiple times.

NERDTree uses different buffer names for every instance: "NERD_tree_1", "NERD_tree_2", etc. (this is done in lib/nerdtree/creator.vim - s:Creator._nextBufferName() ). Nerdtree-tabs breaks it.

@matjon
Copy link
Author

matjon commented Jan 20, 2015

This bug could be probably replicated with native NERDTree - when I do

:NERDTreeMirror
:NERDTreeMirrorOpen

I have the same buffer in two tabs.

@mhinton
Copy link

mhinton commented Mar 6, 2015

I have run into this error as well and it's pretty annoying. Right now I am working around it by closing NERDTree before doing mksession.

@jpmorris
Copy link

Same error. @mhinton 's workaround works for me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants