Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty buffer is created when using vsplit(s) on a previously opened and closed file. #1097

Closed
9 of 15 tasks
AwkwardKore opened this issue Apr 1, 2020 · 1 comment · Fixed by #1098
Closed
9 of 15 tasks
Labels

Comments

@AwkwardKore
Copy link
Contributor

Self-Diagnosis

  • I have searched the issues for an answer to my question.
  • I have reviewed the NERDTree documentation. :h NERDTree
  • I have reviewed the Wiki.
  • I have searched the web for an answer to my question.

Environment (for bug reports)

  • Operating System: MacOS 10.15.4
  • Vim/Neovim version :echo v:version: vim 801
  • NERDTree version, found on 1st line in NERDTree quickhelp ?: 6.7.0
  • vimrc settings
    • NERDTree variables
    let NERDTreeShowHidden=1
    let NERDTreeIgnore=['\.DS_Store$', '\.swp$', '\.git$']
    let NERDTreeShowLineNumbers=1
    let NERDTreeMinimalUI=1
    let NERDTreeWinSize=35
    let g:NERDTreeStatusline='NERDTree'
    • Other NERDTree-dependent Plugins
      • jistr/vim-nerdtree-tabs
      • ryanoasis/vim-devicons
      • tiagofumo/vim-nerdtree-syntax-highlight
      • Xuyuanp/nerdtree-git-plugin
      • Others (specify):
    • I've verified the issue occurs with only NERDTree installed.

Steps to Reproduce the Issue

  1. Create two files in an empty directory: file1.txt and file2.txt.
  2. Open vim in that directory.
  3. Open file1.txt with nerdtree o.
  4. Open file2.txt with nerdtree o.
  5. Delete buffer where file1.txt is open :bd {buffer number}
  6. Open file1.txt as vsplit with nerdtree s

Current Result (Include screenshots where appropriate.)

You get a new empty buffer on the buffer list, in this case it was the buffer 4 [No Name]:

Screen Shot 2020-03-31 at 19 54 00

If you do the 6 steps and keep quitting :q the file1.txt and opening again with vsplits, it keeps creating new empty buffers. Note that this time I didn't delete the buffer, I just quit the file with :q. This means that you only have to delete the buffer once and keep using vsplits for it to trigger the issue multiple times. This is after quitting and opening the same file 3 times:

Screen Shot 2020-03-31 at 20 11 46

Expected Result

The expected result should be the two files open on vsplit without having to create a new empty buffer. Since it has another open file on vim, it shouldn't have to open a new empty buffer. This expected behavior is what happens when you use split command on nerdtreei instead of vsplits. They should behave the same when it comes to handling the buffers:

Screen Shot 2020-03-31 at 20 00 38

Comments

I already have the solution to this problem on my forked repository. I created this issue because this seems like a bug but I don't know if this is actually the correct behavior.

@AwkwardKore AwkwardKore added the bug label Apr 1, 2020
@PhilRunninger
Copy link
Member

I confirmed this behavior, and it definitely is not correct. Go ahead and create a pull request to merge your fix in.

Thanks!

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

Successfully merging a pull request may close this issue.

2 participants