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

Error detected while processing function nerdtree#postSourceActions[2]..nerdtree#ui_glue#createDefaultBindings #1051

Closed
10 of 15 tasks
Ryuno-Ki opened this issue Oct 16, 2019 · 9 comments
Labels

Comments

@Ryuno-Ki
Copy link

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: Sabayon Linux
  • Vim/Neovim version :echo v:version: 801
  • NERDTree version, found on 1st line in NERDTree quickhelp ?: 6.1.3 (commit 926ff0e with minpac)
  • vimrc settings
    • NERDTree variables: map <silent> <F2> :NERDTreeToggle<CR>, full .vimrc at the bottom.
    • Other NERDTree-dependent Plugins
      • jistr/vim-nerdtree-tabs
      • ryanoasis/vim-devicons
      • tiagofumo/vim-nerdtree-syntax-highlight
      • Xuyuanp/nerdtree-git-plugin
      • Others (specify): None
    • I've verified the issue occurs with only NERDTree installed. How would I do that?

Steps to Reproduce the Issue

  1. Open a file with Vim

Current Result (Include screenshots where appropriate.)

First an error message:

LC_ALL=C vim ~/.vimrc
Error detected while processing function nerdtree#postSourceActions[2]..nerdtree#ui_glue#createDefaultBindings:
line   10:
E121: Undefined variable: g:NERDTreeMapCustomOpen
E116: Invalid arguments for function NERDTreeAddKeyMap
line   11:
E121: Undefined variable: g:NERDTreeMapCustomOpen
E116: Invalid arguments for function NERDTreeAddKeyMap
line   12:
E121: Undefined variable: g:NERDTreeMapCustomOpen
E116: Invalid arguments for function NERDTreeAddKeyMap
line   13:
E121: Undefined variable: g:NERDTreeMapCustomOpen
E116: Invalid arguments for function NERDTreeAddKeyMap
Press ENTER or type command to continue

Then, hitting return on an opened NERDTree does nothing.

Expected Result

No error message on startup.
Hitting return on a file in NERDTree loads that file in the current buffer.

Full .vimrc

packadd minpac
call minpac#init()
" Always loading these plugins
call minpac#add('editorconfig/editorconfig-vim')
call minpac#add('Glench/Vim-Jinja2-Syntax')
call minpac#add('junegunn/fzf')
call minpac#add('scrooloose/nerdtree')
call minpac#add('tpope/vim-projectionist')
call minpac#add('tpope/vim-unimpaired')

" Optional vim plugins
call minpac#add('ap/vim-css-color', {'type': 'opt'})
call minpac#add('freitass/todo.txt-vim', {'type': 'opt'})
call minpac#add('heavenshell/vim-jsdoc', {'type': 'opt'})
call minpac#add('k-takata/minpac', {'type': 'opt'})
call minpac#add('mattn/emmet-vim', {'type': 'opt'})
call minpac#add('python-mode/python-mode', {'type': 'opt'})
call minpac#add('tpope/vim-scriptease', {'type': 'opt'})
call minpac#add('w0rp/ale', {'type': 'opt'})

" keybindings
map <silent> <F2> :NERDTreeToggle<CR>
nnoremap <C-p> :<C-u>FZF<CR>

" syntax highlighting
au BufNewFile,BufRead *.ejs set filetype=html
au BufNewFile,BufRead *.njk set filetype=jinja
au BufNewFile,BufRead *.svelte set syntax=html

" ex commands
command! PackUpdate packadd minpac | source $MYVIMRC | call minpac#update('', {'do': 'call minpac#status()'})
command! PackClean  packadd minpac | source $MYVIMRC | call minpac#clean()
command! PackStatus packadd minpac | source $MYVIMRC | call minpac#status()

" misc
set incsearch
set number
colorscheme elflord
@Ryuno-Ki Ryuno-Ki added the bug label Oct 16, 2019
@PhilRunninger
Copy link
Member

Let's do a quick sanity check first. Look in your nerdtree/plugin/NERD_tree.vim file. Line 126 is where g:NERDTreeMapCustomOpen is defined. It should look like this:

call s:initVariable("g:NERDTreeMapCustomOpen", "<CR>")
  1. Does <CR> show correctly when you look at NERDTree's quick help?
    " <CR>: custom open
    
  2. I wonder if your environment requires some escaping to be used. The jump to next/previous sibling keys also use angle brackets. Do <C-j> and <C-k> work in your NERDTree?
  3. Does putting this line in your .vimrc help?
    let g:NERDTreeMapCustomOpen = '<CR>'
    
  4. Or does it work only if you use a different key, like Z for instance?
    let g:NERDTreeMapCustomOpen = 'Z'
    

@Ryuno-Ki
Copy link
Author

nerdtree/plugin/NERD_tree.vim defines another thing in line 126:
call s:initVariable("g:NERDTreeMapChangeRoot", "C")

The code you references is written in line 124, though:
call s:initVariable("g:NERDTreeMapCustomOpen", "<CR>")

  1. It does not show up. In fact, „Custom mappings” is completely empty for me.
  2. <C-j> and <C-k> don't show any effect for me either.
  3. Nope.
  4. Hitting it twice closes Vim :o

@PhilRunninger
Copy link
Member

@Ryuno-Ki Wow! Has it really been a year since this was opened? Sorry I dropped the ball on this one. Is this still an issue for you?

@Ryuno-Ki
Copy link
Author

I completely forget about it, too!
I switched laptops, so not sure. Let's agree on closing it.

@mikehagerty
Copy link

Still an issue! I just installed NERDTree and opened vim with no arguments and it presents the same error. The NERDTreeMapCustomOpen line is not present in my brand new ../nerdtree/plugin/NERD_tree.vim file,
so maybe this doesn't get added until I create some customopen mapping(s) ? Either way, it shouldn't report the error on first start up!

@Try2Code
Copy link

same problem on my machine after installation

@JoeWroe
Copy link

JoeWroe commented Mar 30, 2023

I've got it too!

@az-z
Copy link

az-z commented Jan 5, 2024

fresh install. And we have the same problem too. @PhilRunninger , is it worth to revisit the problem, please ?

@rzvxa
Copy link
Member

rzvxa commented Jan 6, 2024

Hey @az-z, Phil has retired from the project(see #1280) for quite a while now; I wasn't aware of this issue since it was already closed when I joined the project, But I think I can help with that.
Is it possible for you to create a new issue using the Bug template?
Just make sure to fill in the requested information, And first try a minimal vimrc. Create a new config file and just load the newest version of NERDTree without anything else and see if that will create any errors.

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

7 participants