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... after using <m> bottom panel stays bigger and wont disappear #1321

Closed
hditano opened this issue Aug 19, 2022 · 13 comments
Closed
Labels

Comments

@hditano
Copy link

hditano commented Aug 19, 2022

Hello all.
Here's my current issue/bug.
Anyone having the same problem?

Operating System: Ubuntu 22.04
Vim/Neovim version 0.7.2
NERDTree version, found on first line of quickhelp ?: 6.10.16
Are you using any of these NERDTree-dependent plugins? No nerdtree dependent plugin.
Provide a minimal .vimrc file that will reproduce the issue.

set number
set mouse=a
set numberwidth=1
set clipboard=unnamed
syntax on
set showcmd
set ruler
set cursorline
set encoding=utf-8
set showmatch
set sw=2
set relativenumber
set laststatus=2
set noshowmode
set scrolloff=8
set updatetime=300
set signcolumn=yes


call plug#begin()

Plug 'wakatime/vim-wakatime'

" LspConfig
"Plug 'neovim/nvim-lspconfig'
"Plug 'hrsh7th/cmp-nvim-lsp'
"Plug 'hrsh7th/cmp-buffer'
"Plug 'hrsh7th/cmp-path'
"Plug 'hrsh7th/cmp-cmdline'
"Plug 'hrsh7th/nvim-cmp'
"Plug 'SirVer/ultisnips'
"Plug 'quangnguyen30192/cmp-nvim-ultisnips'


Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'branch' : '0.1.x' }
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/nvim-treesitter-context'
Plug 'preservim/nerdtree'
"Plug 'SirVer/ultisnips'
"Plug 'honza/vim-snippets'
Plug 'jiangmiao/auto-pairs'
Plug 'morhetz/gruvbox'
Plug 'shinchu/lightline-gruvbox.vim'
Plug 'maximbaz/lightline-ale'
Plug 'itchyny/lightline.vim'
Plug 'alvan/vim-closetag'
Plug 'tpope/vim-surround'

Plug 'benmills/vimux'
Plug 'christoomey/vim-tmux-navigator'

Plug 'editorconfig/editorconfig-vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'easymotion/vim-easymotion'
Plug 'mhinz/vim-signify'

Plug 'yggdroot/indentline'
Plug 'scrooloose/nerdcommenter'

Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-repeat'

call plug#end()
lua <<EOF
require'nvim-treesitter.configs'.setup {
  highlight = {
    enable = true,
  },
require'treesitter-context'.setup{
enable = true,
max_lines = 10,
  }
}
EOF
Untitled_.Aug.19.2022.8_13.PM.mp4
@hditano hditano added the bug label Aug 19, 2022
@greenmoss
Copy link

greenmoss commented Aug 20, 2022

This is also happening to me, but in my case I strongly suspect there is a compatibility problem between NERDTree and vim 9.0

$ vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Aug 13 2022 18:35:05)
macOS version - x86_64
Included patches: 1-200
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby              +wildignore
+cursorbind        +lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            -X11
+digraphs          +mouse             -sound             -xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        -mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static
   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 -D_REENTRANT -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@1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lm -lncurses -liconv -lintl -framework AppKit -L/usr/local/opt/lua/lib -llua5.4 -mmacosx-version-min=12.0 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level/CORE -lperl -L/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/config-3.10-darwin -lpython3.10 -framework CoreFoundation -lruby.3.1 -L/usr/local/Cellar/ruby/3.1.2/lib

Nerdtree Git commit has no tag, ref fc85a6f07c2cd694be93496ffad75be126240068

More tests to narrow it down to NerdTree:

  • start vim without nerdtree
  • type :set to see multiline bottom command area
  • type exit and observe the multiline area disappears
  • type :NERDTree to enable nerdtree
  • behavior described by @hditano happens

Other attempts/results:

  • Go backwards in NerdTree Git history, all the way to tag 6.9.0
    • Result: same/broken
  • Use Mac OS built-in vim, version 8.2
    • Result: works properly
  • Go back to Homebrew vim 8.2.5150
    • (hint: download vim.rb from here, then brew install vim.rb)
      • EDIT you probably also want to do brew pin vim
    • Result: works properly

@JeromeBeckett
Copy link

This is also happening to me, but in my case I strongly suspect there is a compatibility problem between NERDTree and vim 9.0

Can confirm that this only became an issue for me once I'd upgraded from Vim 8 to 9.0

@pemako
Copy link

pemako commented Aug 24, 2022

I have the same problem.

  • VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Aug 23 2022 20:41:15)
  • Nerdtree Git commit: fc85a6f

@syatoss
Copy link

syatoss commented Aug 25, 2022

I upgraded to neovim 0.7.3-beta on windows (latest available on choco) and was experiencing the exact same issue.
Form the commets here i can assume that this is a compatability issue between nerdtree and newer versions of vim/neovim.
At least for now downgrading to neovim 0.7.2 fixed the issue.

Not the perfect soluton but at least that way i have a workable enviorment...

@suckerSlayer
Copy link

I also recently upgrade to vim 9, and maybe it's related to the compatibility with vim 9

@vkaracic
Copy link

NVIM v0.8.0-dev-930-ga4e4609d6 has the same issue

@santiagovrancovich
Copy link

santiagovrancovich commented Aug 27, 2022

Same issue here, after some testing it looks like some versions of vim 9.0 break the menu, the last known version to work is vim-9.0.135, after vim-9.0.236 it breaks, but i haven't tried any other version in between.
The issue still persist in the last version compiled from source vim-9.0.284.
I have found some workarounds until the issue is patched, first one is setting the menu to only be displayed in one line, add this in your .vimrc to do that.

let g:NERDTreeMinimalMenu=1

Another workaround I've also found is to resize the terminal or the buffers, this makes me believe the issue may have something to do with that, forcing a redraw does not seem to make any difference.

Edit: Forcing a resize solves the issue, added a pull request with those changes

Edit 2: For those who stumble around this error, it's already fixed by vim in version vim-9.0.0665, updating your vim should fix it now

@igbanam
Copy link

igbanam commented Sep 2, 2022

I have this same problem on Vim 9. I don't know if this PR has been released, but I have the latest release of the plugin as of the time of this comment and this is still an issue. The mini menu workaround seems to be a perfect bandaid for now though

let g:NERDTreeMinimalMenu=1

@comatory
Copy link

comatory commented Oct 5, 2022

Happens on neovim as well.

@zeertzjq
Copy link

zeertzjq commented Oct 6, 2022

vim/vim#11286
vim/vim@0816f47
neovim/neovim#20500

ohno418 added a commit to ohno418/dotfiles that referenced this issue Oct 11, 2022
ustasb added a commit to ustasb/dotfiles that referenced this issue Oct 22, 2022
@softwaregravy
Copy link

For those of who find their way here with this problem, there is a hot-fix here. Applying this locally seemed like the easiest fix for now.

The actual fix should be in VIM, but I use built-in vim, so this was easier for me in the short run.

benthorner added a commit to benthorner/vim-rc that referenced this issue Oct 22, 2022
Workaround for issue #1321 [^1].

The issue doesn't look like it'll be fixed anytime soon. Although
it's a workaround this is just as good as the original behaviour.

[^1]: preservim/nerdtree#1321
undg added a commit to undg/.dot that referenced this issue Oct 25, 2022
joshukraine added a commit to joshukraine/dotfiles that referenced this issue Oct 26, 2022
msarcev added a commit to msarcev/.dotfiles that referenced this issue Oct 31, 2022
cr0t added a commit to cr0t/dotfiles that referenced this issue Nov 1, 2022
Tells NERDtree to stay one line height.

It's also a workaround for the issue discussed here:
preservim/nerdtree#1321
undg added a commit to undg/.dot that referenced this issue Dec 31, 2022
@EnricoSteez
Copy link

EnricoSteez commented Mar 12, 2023

Whoever is still stumbling in this issue, you should check here (as mentioned previously by @softwaregravy).
Just go to wherever the nerdtree code is (something like plugged/nerdtree/lib/nerdtree/) and reproduce the fix by inserting resize at line 175 before the end of the function. It's that simple.

@rzvxa
Copy link
Member

rzvxa commented Oct 22, 2023

This problem is specific to some early versions of Vim9 and there is a patch for it #1322.
I suggest you update your Vim if you are experiencing this problem instead of using the patch mentioned above.

@rzvxa rzvxa closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests