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

If file path doesn't exist, :NERDTreeFind its parent directory instead. #1043

Merged
merged 3 commits into from
Sep 29, 2019

Conversation

PhilRunninger
Copy link
Member

@PhilRunninger PhilRunninger commented Sep 29, 2019

This happens in the following scenario:

:edit path/new_file
:NERDTreeFind

Instead of an error message about an invalid path, this change will
now find the parent directory instead. It will not work if the new file
is path/new_folder/new_file, and that's OK because even vim itself
cannot handle both the new folder and the new file; :w won't create
the new folder.

Description of Changes

Closes #1042


New Version Info

  • Derive a new version number. Increment the:
    • MAJOR version when you make incompatible API changes
    • MINOR version when you add functionality in a backwards-compatible manner
    • PATCH version when you make backwards-compatible bug fixes
  • Update CHANGELOG.md, following the established pattern.
  • Tag the merge commit, e.g. git tag -a 3.1.4 -m "v3.1.4" && git push origin --tags

Phil Runninger added 3 commits September 29, 2019 11:04
This happens in the following scenario:
```
:edit path/new_file
:NERDTreeFind
```
Instead of an error message about an **invalid path**, this change will
now find the parent directory instead. It will not work if the new file
is **path/new_folder/new_file**, and that's OK because even vim itself
cannot handle both the new folder and the new file; `:w` won't create
the new folder.
@PhilRunninger PhilRunninger merged commit 6318406 into master Sep 29, 2019
andys8 added a commit to andys8/nerdtree that referenced this pull request Jan 19, 2020
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
andys8 added a commit to andys8/nerdtree that referenced this pull request Jan 20, 2020
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
rhiroyuki added a commit to rhiroyuki/dotfiles that referenced this pull request Feb 17, 2020
Remove try catch since its not necessary anymore (it doesnt raise the
error and instead it opens the parent root directory).

For more info:
preservim/nerdtree#1043
bouk added a commit to bouk/nerdtree that referenced this pull request Feb 20, 2020
Right now it just reveals the directory but leaves it closed.

Related to preservim#1043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

:NERDTreeFind for newly created and yet unsaved files
1 participant