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

Files do not appear in the folder. #526

Closed
dgorodnichybak opened this issue Dec 29, 2015 · 14 comments
Closed

Files do not appear in the folder. #526

dgorodnichybak opened this issue Dec 29, 2015 · 14 comments
Labels

Comments

@dgorodnichybak
Copy link

Hello. Files do not hidden, but when I open folder it looks empty. When I explore empty dir, files displayed (right column on attached image). After reloading vim files are displayed.

2fd1773ad3

@dgorodnichybak dgorodnichybak changed the title Files do not show in folder. Files do not appear in the folder. Dec 29, 2015
@dgorodnichybak
Copy link
Author

Update: This only happens after I press "x" on folder.

@chrisyue
Copy link

+1
same issue

@igkuz
Copy link

igkuz commented Jan 12, 2016

+1 the same problem

@Hates
Copy link

Hates commented Jan 18, 2016

+1 Same problem

1 similar comment
@iamcco
Copy link

iamcco commented Mar 8, 2016

+1 Same problem

@athallas
Copy link

Duplicate: #519
Same issue.

@noscripter
Copy link

The problem still exists.

@mzavoloka
Copy link

I experience this bug when I go up twice from a directory that is a single item in its parent directory.

For example (as shown on OP's screenshot), I open vim from directory controllers/admin. Then I press 'u'. And then I press 'u' again. At this step I see the directory structure like on the screenshot (>controllers/admin). And I'm not able to view the contents of controllers/admin even if I press 'R' or 'r'.

#519 is a bit different issue. I have updated to the latest version at the moment.

@mzavoloka
Copy link

mzavoloka commented Jun 29, 2017

mkdir ttt
mkdir ttt/ttt/
touch ttt/ttt/test
cd ttt/ttt/
vim test

Inside vim:
:NERDTreeToggle
u
u
And now you're not able to view the contents of folder ttt/ttt.

@lifecrisis
Copy link
Contributor

lifecrisis commented Jun 29, 2017

I can now replicate this bug, and I believe it to be confirmed. Replicate with these steps:

  1. Point the NERDTree root to a directory that will cascade beneath its parent.
  2. Press u twice.
  3. Note that the cascaded directory will no longer open.

You can do this in the NERDTree repository itself by making the root nerdtree/lib/nerdtree/ pressing u twice, and then trying to open lib/nerdtree/ again.

Bug confirmed.

@lifecrisis lifecrisis added the bug label Jun 29, 2017
@PhilRunninger
Copy link
Member

Look at the NERDTreeCascadeSingleChildDir option. When set to 1, the default, I see the behavior described in this issue. A workaround is to set it to 0.

@lifecrisis
Copy link
Contributor

lifecrisis commented Jun 29, 2017

Hey, @PhilRunninger, I think I've got this one. A possible duplicate is issue #547. I also have a fix in progress. I believe the problem can be captured in a few words as follows:

When you make a directory that belongs to a cascade the NERDTree root, pressing u repeatedly will close every directory in the chain along the way up. Then, when you try to open the cascaded node with o, the mapping opens the lowest directory node in the cascade while leaving the ancestor nodes closed. That is, the mappings are operating on the tail of the cascade, not the immediate child of the current root node.

The rendering logic never reaches the open node at the bottom of the cascade, and the children there cannot be displayed because their ancestors are "closed" from the point of view of the NERDTree. This also explains why the open/closed status indicator (+ or ~ on Windows) changes while the children never render.

lifecrisis pushed a commit to lifecrisis/nerdtree that referenced this issue Jul 2, 2017
Issues preservim#547 and preservim#526 reported a problem with the "open()" method in
the "TreeDirNode" class.

Specifically, opening a cascade in the NERDTree will perform the
opening operation on the tail of the cascade. This is a problem when
other operations (such as the "u" mapping) close intermediate
cascaded directories, which causes opening the tail to have no
effect (other than toggling the arrow).

Here, the "open()" method was modified to open all directories in a
cascade whenever the tail is opened. This is the only reasonable fix
for this type of problem.

Fixes preservim#547 and fixes preservim#526.
@lifecrisis
Copy link
Contributor

ANNOUNCEMENT: Everyone experiencing this bug can try the fix in pull request #720. It should repair this problem without any side effects. The code is currently under review.

@mzavoloka
Copy link

Works for me, thx.

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

10 participants