Skip to content

Error detected while processing BufEnter Autocommands for "*" with the "Close the tab if NERDTree is the only window remaining in it." config #1411

@lafrech

Description

@lafrech

Environment

Nope, I removed all plugins.

  • Provide a minimal .vimrc file that will reproduce the issue.
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif

Steps to Reproduce the Issue

Open a file, open NERDTree, open another file, open NERDTree, close a file.

Current Behavior (Include screenshots where appropriate.)

I get this error message

Error detected while processing BufEnter Autocommands for "*":

Press ENTER or type command to continue

and NERDTree is still open.

Expected Result

Tab closes.


This reminds me of jistr/vim-nerdtree-tabs#102.

I'm trying to get rid of vim-nerdtree-tabs because it is unmaintained and because I realized what I'm using it for should be achievable using the sample config lines from NERDTree README.

I'm surprised I'm getting that same error.

I removed all plugins and kept that single line in the config file, which makes me wonder how come no one else is affected. I don't see anything specific in my setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions