lambdalisue / vim-fern

🌿 General purpose asynchronous tree viewer written in Pure Vim script
MIT License
1.29k stars 49 forks source link

Deleting items not working somehow #443

Closed alextes closed 1 year ago

alextes commented 2 years ago

Hi (:

When I delete an item using fern it gives a little message "1 items are trashed", but nothing actually gets removed.

Could you point me in the right direction for debugging this?

I use an alias for 'rm' called safe-rm maybe it has something to do with that.

This functionality used to work fine for me. I'm not sure what changed.

Thanks for a great plugin 💛 !

alextes commented 2 years ago

After digging through the help files and trash-cli I see fern offers to safely delete instead of outright shred your files forever, which is great. I usually don't need it due to git but sometimes it's nice. So for me, I guess it would work to be able to tell Fern, "hey, just use my shell's rm or this binary over there that works just like rm" (which is safe-rm).

I'm guessing what changed is that the default went from remove to trash recently. Which for me on macOS isn't working. Or perhaps macOS blocked nvim from using osascript somehow.

lambdalisue commented 2 years ago

So for me, I guess it would work to be able to tell Fern, "hey, just use my shell's rm or this binary over there that works just like rm" (which is safe-rm).

Unfortunately, fern itself does not provide such action (remove action use delete() function of Vim script). You can make it by yourselves.

I'm guessing what changed is that the default went from remove to trash recently.

Fern didn't change the behavior. The default behavior of D mapping is 'trash' action from very early version of fern.

Which for me on macOS isn't working. Or perhaps macOS blocked nvim from using osascript somehow.

Maybe? I'm sorry but I've no idea what's going on in your system.

alextes commented 2 years ago

Okay @lambdalisue, thanks! Any pointer to docs on how I could bind "take the path of the thing under the cursor or these highlighted files (does Fern expose this somehow?) and pass all of them to safe-rm?

If there aren't that's okay, just close this issue and we'll leave it for someone with more vim skill than me to maybe build one day 😄 .

alextes commented 2 years ago

Oh! and we haven't at all tried to debug why osascript isn't working, any idea how I could check what exactly is going wrong when fern tries to call macOS to tell it to trash something?

lambdalisue commented 2 years ago

Okay @lambdalisue, thanks! Any pointer to docs on how I could bind "take the path of the thing und

Fern provides docs for developers as :help fern-developer :+1:

Oh! and we haven't at all tried to debug why osascript isn't working, any idea how I could check what exactly is going wrong when fern tries to call macOS to tell it to trash something?

Try this function directly and see what's happen.

https://github.com/lambdalisue/fern.vim/blob/d134808916cb7ccd0800830032d07a0757ed68ee/autoload/vital/_fern/Async/File.vim#L232-L239

lambdalisue commented 2 years ago

@alextes Any update? Shall I close the issue?

lambdalisue commented 2 years ago

Oops, closed by mistake

alextes commented 2 years ago

We can close, I switched to Lua based plugins.

This one served me well for a long time. Thanks!

pencilcheck commented 1 year ago

man that sucks, the trash suddenly stops working for me on OSX as well. Not sure why. If you have the recommendation on which to switch over that would be awesome.

Or if someone can help fix this that would be awesome too.

My workaround right now is to create a new mapping to run delete instead of trash https://github.com/lambdalisue/fern.vim/issues/366