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

Vim closes automatically when try to open a directory #269

Open
2 of 7 tasks
dgdavid opened this issue Feb 5, 2018 · 2 comments
Open
2 of 7 tasks

Vim closes automatically when try to open a directory #269

dgdavid opened this issue Feb 5, 2018 · 2 comments

Comments

@dgdavid
Copy link
Contributor

dgdavid commented Feb 5, 2018

Environment

  • OS:
    • Linux
    • macOS
    • Windows
    • FreeBSD
  • Vim:
    • Terminal Vim
    • GVim
    • NeoVim

:version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jul 26 2017 19:10:24)
Included patches: 1-503, 505-642
Compiled by root@apple.com
Normal version without GUI.  Features included (+) or not (-):
+acl             +cmdline_compl   +digraphs        +folding         -langmap         -mouseshape      -mzscheme        -python3         +syntax          -toolbar         +writebackup
-arabic          +cmdline_hist    -dnd             -footer          +libcall         -mouse_dec       +netbeans_intg   +quickfix        +tag_binary      +user_commands   -X11
+autocmd         +cmdline_info    -ebcdic          +fork()          +linebreak       -mouse_gpm       +num64           +reltime         +tag_old_static  +vertsplit       -xfontset
-balloon_eval    +comments        -emacs_tags      -gettext         +lispindent      -mouse_jsbterm   +packages        -rightleft       -tag_any_white   +virtualedit     -xim
-browse          -conceal         +eval            -hangul_input    +listcmds        -mouse_netterm   +path_extra      +ruby/dyn        -tcl             +visual          -xpm
+builtin_terms   +cryptv          +ex_extra        +iconv           +localmap        -mouse_sgr       -perl            +scrollbind      -termguicolors   +visualextra     -xsmp
+byte_offset     +cscope          +extra_search    +insert_expand   -lua             -mouse_sysmouse  +persistent_undo +signs           +terminfo        +viminfo         -xterm_clipboard
+channel         +cursorbind      -farsi           +job             +menu            -mouse_urxvt     +postscript      +smartindent     +termresponse    +vreplace        -xterm_save
+cindent         +cursorshape     +file_in_path    +jumplist        +mksession       +mouse_xterm     +printer         +startuptime     +textobjects     +wildignore
-clientserver    +dialog_con      +find_in_path    -keymap          +modify_fname    +multi_byte      -profile         +statusline      +timers          +wildmenu
-clipboard       +diff            +float           +lambda          +mouse           +multi_lang      +python/dyn      -sun_workshop    +title           +windows
   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/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework Cocoa

Problem Description

After commit c66930e, vim closes automatically when try to open a directory

If line

autocmd BufEnter * if 0 == len(filter(range(1, winnr('$')), 'empty(getbufvar(winbufnr(v:val), "&bt"))')) | qa! | endif
is commented, the problem disappear.

liuchengxu added a commit that referenced this issue Feb 6, 2018
There is an issue with the current approach. Revert to the previous one.
See #269
@liuchengxu
Copy link
Owner

Thanks for your report. I can reproduce and have reverted to the previous approach to quit vim automatically when there is only one quickfix/location list/nerdtree buffer. Please pull the latest commit to fix this issue.

However, there is an obvious disadvantage: it can't handle the situation where nerdtree and quickfix buffer exist at the same time. I'll dive into this when I get some time. Any help is also appreciated.

@dgdavid
Copy link
Contributor Author

dgdavid commented Feb 6, 2018

and have reverted to the previous approach

Thank you for fixing it :)

However, there is an obvious disadvantage: it can't handle the situation where nerdtree and quickfix buffer exist at the same time. I'll dive into this when I get some time. Any help is also appreciated.

Sorry, I do not have enough knowledge about it :( I hope someone out there could give you a hand.

alvin2ye pushed a commit to alvin2ye/space-vim that referenced this issue Jan 31, 2019
There is an issue with the current approach. Revert to the previous one.
See liuchengxu#269
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants