Fuco1 / dired-hacks

Collection of useful dired additions
GNU General Public License v3.0
847 stars 76 forks source link

dired-subtree + dired-collapse #126

Open jojojames opened 6 years ago

jojojames commented 6 years ago

Haven't found the time to create a small repro but it seems like trying to cycle a 'dired-collapse' 'node' results in weird behavior. Not sure how to describe it but the nodes just don't seem to draw correctly after.

I'm not sure what the expected behavior is when toggling a dired-collapse node anyways so I think this might be undefined territory.

ChoppinBlockParty commented 5 years ago

Does dired-subtree and dired-collapse work fine together, because I have troubles configuring it together. For me using dired-subtree-toggle on collapsed nodes (like `some/path/to/{file1,file2,file3}) does not seem to work at all. Does it work for you?

jojojames commented 5 years ago

It doesn't for me.

Fuco1 commented 5 years ago

@ChoppinBlockParty Can you provide some repro case? I don't see many reasons why this shouldn't work because it mostly uses dired internals, but there might be some issues with hook order for example, which can also depend on the order you enable the various modes.

ChoppinBlockParty commented 5 years ago

Sure.

In the current dired directory I have prevdir, some/path/file1, some/path/file2, and yodir. They will look like

prevdir
some/path
<^cursor>
yodir

I hit a key bound to dired-subtree-toggle.

prevdir
  some/path
  <^cursor>
  file1
  file2
yodir

If I call toggle again I get No such file or directory, <current dir>/some/path/some/path If I place cursor on prevdir and call toggle, I will get

prevdir
yodir
ChoppinBlockParty commented 5 years ago

Oh, yes, I have only this hook

(add-hook 'dired-mode-hook 'dired-collapse-mode)
garrett-hopper commented 4 years ago

I'm seeing some strange behavior when combining dired-subtree and dired-collapse. It doesn't seem to work well if the final item in the subtree is something that would be collapsed. I'm using dired-subtree-toggle, and multiple artifacts are being created by dired-collapse for the final item in the folder.

.
└── alpha
    ├── bravo
    └── charlie
        └── delta

scrot

chiply commented 4 years ago

If it helps, I can confirm I also experience the exact same issue. If the final item in the subtree is one of those directories that get altered by dired-collapse, you get the behavior seen above. If the subtree is not the final item in the subtree, things seem to work normally.