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

NERDTree crashes at Vim startup #1000

Closed
arg opened this issue Jun 10, 2019 · 7 comments · Fixed by #1001
Closed

NERDTree crashes at Vim startup #1000

arg opened this issue Jun 10, 2019 · 7 comments · Fixed by #1001

Comments

@arg
Copy link

arg commented Jun 10, 2019

Environment

  • Operating System: MacOS 10.14.5

  • Vim version :version: 8.1

    More details
    VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun  9 2019 07:22:39)
    macOS version
    Included patches: 1-1500
    Compiled by Homebrew
    Huge version without GUI.  Features included (+) or not (-):
    +acl               +conceal           +folding           +menu              +packages          -sun_workshop      +virtualedit
    +arabic            +cryptv            -footer            +mksession         +path_extra        +syntax            +visual
    +autocmd           +cscope            +fork()            +modify_fname      +perl              +tag_binary        +visualextra
    +autochdir         +cursorbind        +gettext           +mouse             +persistent_undo   -tag_old_static    +viminfo
    -autoservername    +cursorshape       -hangul_input      -mouseshape        +postscript        -tag_any_white     +vreplace
    -balloon_eval      +dialog_con        +iconv             +mouse_dec         +printer           -tcl               +wildignore
    +balloon_eval_term +diff              +insert_expand     -mouse_gpm         +profile           +termguicolors     +wildmenu
    -browse            +digraphs          +job               -mouse_jsbterm     -python            +terminal          +windows
    ++builtin_terms    -dnd               +jumplist          +mouse_netterm     +python3           +terminfo          +writebackup
    +byte_offset       -ebcdic            +keymap            +mouse_sgr         +quickfix          +termresponse      -X11
    +channel           +emacs_tags        +lambda            -mouse_sysmouse    +reltime           +textobjects       -xfontset
    +cindent           +eval              +langmap           +mouse_urxvt       +rightleft         +textprop          -xim
    -clientserver      +ex_extra          +libcall           +mouse_xterm       +ruby              +timers            -xpm
    +clipboard         +extra_search      +linebreak         +multi_byte        +scrollbind        +title             -xsmp
    +cmdline_compl     -farsi             +lispindent        +multi_lang        +signs             -toolbar           -xterm_clipboard
    +cmdline_hist      +file_in_path      +listcmds          -mzscheme          +smartindent       +user_commands     -xterm_save
    +cmdline_info      +find_in_path      +localmap          +netbeans_intg     +startuptime       +vartabs
    +comments          +float             +lua               +num64             +statusline        +vertsplit
    system vimrc file: "$VIM/vimrc"
    user vimrc file: "$HOME/.vimrc"
    2nd user vimrc file: "~/.vim/vimrc"
    user exrc file: "$HOME/.exrc"
    defaults file: "$VIMRUNTIME/defaults.vim"
    fall-back for $VIM: "/usr/local/share/vim"
    Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
    Linking: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.14 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.30.0/lib/perl5/5.30.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation -lruby.2.6
    
  • NERDTree version git rev-parse --short HEAD: 28eb47e

  • NERDTree settings applied in your vimrc, if any:

    " Auto open NERDTree
    autocmd StdinReadPre * let s:std_in=1
    autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
    
    " hide NERDTree on file open
    let NERDTreeQuitOnOpen = 1
    
    " do not display NERDTree help
    let NERDTreeMinimalUI = 1
    
    " Close Vim if only NERDTree buffer is on
    autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif

Process

  1. Copy
    autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
    from Readme and add it to ~/.vimrc
  2. Open Vim (e.g. vim ~/dev/project)

Current Result

Vim crashes

NERD_tree_1
Error detected while processing function 188[2]..189[15]..216:
line   27:
E444: Cannot close last window
Press ENTER or type command to continue

After pressing Enter Vim continues to load.

Expected Result

Vim should start normally.

Screenshot(s)

Screen Shot 2019-06-10 at 20 53 20

Possible Fix

@edgard
Copy link

edgard commented Jun 11, 2019

Same here, reverting commit from #999 fixes the behavior.

@jgeiger
Copy link

jgeiger commented Jun 11, 2019

This doesn't crash neovim for me, but all windows now open minimized on the right of the screen. Reverting #999 seems to fix that issue as well.

@JediLuke
Copy link

JediLuke commented Jun 12, 2019

Just chiming in that I too am getting this behaviour on Mac High Sierra using NeoVim. It doesnt crash for me though, I get the warning saying 'cannot close last window' but pressing enter makes it go away and then Neovim behaves normally and as expected

Reverting the commit also worked for me. To make life easier for the next person, this is how you do it:

cd ~/.vim/plugged
git checkout 67fa9b3

This will put you in detached HEAD state. If you're using this plugin there's a good chance you can use git so you know what that means. Restarting NeoVim worked for me though. Also your plugins directory may be different, you can see it in your init.vim file where you have declared all your plugins

@PhilRunninger
Copy link
Member

PhilRunninger commented Jun 12, 2019

@arg @edgard @jgeiger @JediLuke @thinker3

Can you all checkout PR #1001 for me. It works on my machine, but you know how that goes. The branch name is fix_999.

@edgard
Copy link

edgard commented Jun 12, 2019

Yeah, with that branch it's working as expected. :)

@JediLuke
Copy link

Working for me too

@arg
Copy link
Author

arg commented Jun 13, 2019

Working fine now, thanks!

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

Successfully merging a pull request may close this issue.

5 participants