Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lua/sidebar-nvim/builtin/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local Loclist = require("sidebar-nvim.components.loclist")
local config = require("sidebar-nvim.config")
local has_devicons, devicons = pcall(require, "nvim-web-devicons")
local luv = vim.loop
local uv = vim.uv

local loclist = Loclist:new({ omit_single_group = false, show_group_count = false })

Expand All @@ -19,7 +20,6 @@ local cut_files = {}
local open_directories = {}

local history = { position = 0, groups = {} }
local trash_dir = luv.os_homedir() .. "/.local/share/Trash/files/"

local function get_fileicon(filename)
if has_devicons and devicons.has_loaded() then
Expand Down Expand Up @@ -245,7 +245,7 @@ local function delete_file(src, trash, confirm_deletion)
end
end

luv.fs_rename(src, trash, function(err, _)
uv.fs_rename(src, trash, function(err, _)
if err ~= nil then
vim.schedule(function()
utils.echo_warning(err)
Expand Down Expand Up @@ -330,7 +330,7 @@ return {
move_file(operation.dest, operation.src, true)
end,
src = location.node.path,
dest = trash_dir .. location.node.name,
dest = config.trash_dir .. location.node.name,
}
local group = { executed = false, operations = { operation } }

Expand Down Expand Up @@ -386,7 +386,7 @@ return {
copy_file(operation.src, operation.dest, true)
end,
undo = function()
delete_file(operation.dest, trash_dir .. utils.filename(operation.src), true)
delete_file(operation.dest, config.trash_dir .. utils.filename(operation.src), true)
end,
src = path,
dest = dest_dir .. "/" .. utils.filename(path),
Expand Down Expand Up @@ -448,7 +448,7 @@ return {
create_file(operation.dest)
end,
undo = function()
delete_file(operation.dest, trash_dir .. name, true)
delete_file(operation.dest, config.trash_dir .. name, true)
end,
src = nil,
dest = parent .. "/" .. name,
Expand Down
3 changes: 3 additions & 0 deletions lua/sidebar-nvim/config.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
local M = {}
local luv = vim.loop

M.disable_default_keybindings = 0
M.bindings = nil
M.side = "left"
M.initial_width = 35

M.trash_dir = luv.os_homedir() .. "/.local/share/Trash/files/"

M.hide_statusline = false

M.update_interval = 1000
Expand Down