dired-hacks icon indicating copy to clipboard operation
dired-hacks copied to clipboard

dired-subtree + dired-collapse

Open jojojames opened this issue 7 years ago • 7 comments

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.

jojojames avatar Jan 07 '18 18:01 jojojames

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?

ChoppinBlockParty avatar Oct 07 '18 17:10 ChoppinBlockParty

It doesn't for me.

jojojames avatar Oct 07 '18 21:10 jojojames

@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.

Fuco1 avatar Oct 08 '18 09:10 Fuco1

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 avatar Oct 08 '18 10:10 ChoppinBlockParty

Oh, yes, I have only this hook

(add-hook 'dired-mode-hook 'dired-collapse-mode)

ChoppinBlockParty avatar Oct 08 '18 12:10 ChoppinBlockParty

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

garrett-hopper avatar Oct 06 '19 20:10 garrett-hopper

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.

chiply avatar Jan 29 '20 21:01 chiply