sidebar.nvim icon indicating copy to clipboard operation
sidebar.nvim copied to clipboard

Incorrect Trash Path for MacOS

Open devkav opened this issue 1 year ago • 0 comments

Describe the bug The trash_dir variable defined in lua/sidebar-nvim/builtin/files.lua is incorrect for MacOS. This causes an error, since the given path cannot be found. The correct path is $HOME/.Trash/. This means that users on MacOS are unable to delete files using the sidebar.

To Reproduce Steps to reproduce the behavior:

  1. Open sidebar.nvim in MacOS
  2. Hover over a file in the sidebar
  3. Press the d key
  4. Observer the error

Expected behavior Deleted files should be moved to $HOME/.Trash and not raise an error.

Screenshots Screenshot 2024-08-13 at 4 51 45 PM

Environment (please complete the following information):

  • nvim version
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478
Run "nvim -V1 -v" for more info
  • sidebar config
require("sidebar-nvim").setup({
 open = true,
 sections = {"files", "todos", "git"},
 files = {
   show_hidden = true
 }
})
vim.keymap.set("n", "<leader>f", vim.cmd.SidebarNvimFocus)

Additional context I was able to fix this issue on a personal fork by updating trash_dir to be $HOME/.Trash.

devkav avatar Aug 13 '24 20:08 devkav