dired-hacks
dired-hacks copied to clipboard
dired-subtree + dired-collapse
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.
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?
It doesn't for me.
@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.
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
Oh, yes, I have only this hook
(add-hook 'dired-mode-hook 'dired-collapse-mode)
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

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.