-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Self-Diagnosis
i've searched on various platforms including those issues but cannot find anything on the topic.
Edit: added another case where this bug appears.
Environment
-
Operating System: MacOS
-
Vim/Neovim version:
v0.11.2
-
NERDTree version, found on first line of quickhelp
?
:v7.1.3
-
Are you using any of these NERDTree-dependent plugins?
-
Provide a minimal .vimrc file that will reproduce the issue.
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
if !filereadable(vimplug_exists)
echo "Installing Vim-Plug..."
echo ""
silent exec "!\curl -fLo " . vimplug_exists . " --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
let g:not_finish_vimplug = "yes"
autocmd VimEnter * PlugInstall
endif
call plug#begin(expand("~/.config/nvim/plugged"))
Plug 'scrooloose/nerdtree'
call plug#end()
" File browser
let g:NERDTreeChDirMode = 2
" let g:NERDTreeMinimalUI = 1
let g:NERDTreeAutoDeleteBuffer = 1
Steps to Reproduce the Issue and Current Behavior
For folders
- Have a folder starting with a tilde and a file (e.g.
~dir/test
) - Open the NERDTree browser (
:NERDTreeToggle
) - Try to expand the folder by pressing enter on it
It will indicate that the directory is open but show no file inside.
For files
- Have a file starting with a tilde (e.g.
~test
) - Open the NERDTree browser (
:NERDTreeToggle
) - Select the file
It will log the error below; pressing ENTER to dismiss it will still open the file.
E79: Cannot expand wildcards
Press ENTER or type command to continue
Note: Opening ~dir/test
or ~test
from the CLI (nvim ~dir/test
...) throws no error at init but the Tree bugs described above stil trigger.
From within the editor
When in the editor with NERDTree closed and in a project containing files or dirs starting with the tilde, if editing a file within a tilde-prefixed dir, if the file is of depth of 1 (i.e. is at ~dir/file
), the error below is produced.
Error detected while processing function <SNR>49_findAndRevealPath:
line 49:
E716: Key not present in Dictionary: "putCursorHere"
However, if the file is at depth of 2 or more (i.e. at ~dir/another-dir/file
), another error given below occurs.
Error detected while processing function <SNR>49_findAndRevealPath[47]..164[28]..164:
line 28:
E716: Key not present in Dictionary: "reveal"
Error detected while processing function <SNR>49_findAndRevealPath:
line 49:
E1203: Dot can only be used on a dictionary: l:node.putCursorHere(1, 0)
Expected Result
Except for a single ~
as directory name, NERDTree shouldn't try to consider the tilde as anything special and expand it.
It should treat it as-is as the file or directory name.