-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
NERDTreeFind fails with vim-startify or empty buffer #1059
Comments
I'm actually also getting this issue but without vim-startify. |
@willfindlay What's in your buffer when this issue occurs? |
This happens with an empty buffer, too. You can reproduce the error like this: $ echo "new buffer" | vim -
:NERDTreeFind
E716: Key not present in Dictionary: putCursorHere I basically want the behavior of |
The absolut best thing would be if |
Also |
There was a fix in preservim#1043 which improves the behavior for non saved filenames. Those are not on disk, but also not empty. This lead to an issue preservim#1059 where actual "empty files" like created with vim-startify or stdin lead to an error. This change fixes this by adapting the order of the tests. It'll print "no file for the current buffer" for empty files. Solves preservim#1059
The last few comments of myself are probably different feature requests or maybe can be achieved with vimscript. I created a PR to fix the root issue and fail with the wanted error message to close this issue. |
There was a fix in preservim#1043 which improves the behavior for non saved filenames. Those are not on disk, but also not empty. This lead to an issue preservim#1059 where actual "empty files" like created with vim-startify or stdin lead to an error. This change fixes this by adapting the order of the tests. It'll print "no file for the current buffer" for empty files. Solves preservim#1059
I have the same issue when using :NERDTreeFind in an empty buffer. I understand why it happens but it would be great to have a way of achieving this:
EDIT: I don't have vim-startify though. |
@tbergeron if you want to, you can try out the PR #1081 I submitted. I'm confident it should fix the issue, and also might be merged soon. Positive feedback would be nice, though. |
@andys8 I tried your PR and it shows: |
That's the intended behavior. I guess it was like this before it was broken, too. Thanks for testing. |
@andys8 oh I see! 🤣 I thought it would open the current directory if no file is opened in the buffer. I wish there would be some way to toggle to the current opened file. Good job fixing that bug though :P |
Thanks @PhilRunninger |
Description
:NERDTreeFind
prints this error when used withvim-startify
. My guess is this is related.Possible related, because it's working fine with not exisiting/written files:
#1043
The text was updated successfully, but these errors were encountered: