Skip to content

fix(fs_actions): clear buffers when trashing#2036

Merged
pynappo merged 1 commit into
nvim-neo-tree:mainfrom
akioweh:fix/trash-clear-buffers
May 23, 2026
Merged

fix(fs_actions): clear buffers when trashing#2036
pynappo merged 1 commit into
nvim-neo-tree:mainfrom
akioweh:fix/trash-clear-buffers

Conversation

@akioweh
Copy link
Copy Markdown
Contributor

@akioweh akioweh commented May 22, 2026

delete does this so i thought trash should do too?

not super sure about stating files in a loop for the trash_nodes variant but my thoughts were if some individual files failed to be trashed (there doesn't seem to be any communication of partial-failures i believe)?

@akioweh
Copy link
Copy Markdown
Contributor Author

akioweh commented May 22, 2026

on a side note: the trash_node vs trash_nodes logic seem quite asymmetric...? e.g. the multi-node function does not fire pre-delete events and the undostack and post-delete event code are still ran even if trash.trash failed

@pynappo
Copy link
Copy Markdown
Collaborator

pynappo commented May 22, 2026

I genuinely forgot to put this in when adapting the delete code lol so ty, I agree that this should be the expected behavior.

the multi-node function does not fire pre-delete events and the undostack and post-delete event code are still ran even if trash.trash failed

Currently, trash.trash returns false upon any failure, partial or total. so yeah, stat'ing the files in a loop is currently the intended solution

this is also why the undostack and post-trash event code are still ran in the multi node variant - if trash trashed any files at all, it should add something to the undostack and fire some amount of events. in the single node variant I just assume that if the trash failed, there's no need to check further (but maybe i'm wrong on that?)

(there doesn't seem to be any communication of partial-failures i believe)?

Yeah there probably should be some, tbh. Currently the supported trash backends that just use system commands will just log the output of the commands as warnings if they return non-zero error codes, but having more output wouldn't hurt in the case of these partial failures.

Will merge in a bit

@pynappo pynappo merged commit 4d748ef into nvim-neo-tree:main May 23, 2026
17 checks passed
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.

2 participants