Fixes issues with switching to snacks explorer

This commit is contained in:
Michel Fedde 2025-02-16 22:07:56 +01:00
parent 1699bd2574
commit 8892845c03
6 changed files with 12 additions and 17 deletions

View file

@ -18,7 +18,8 @@ vim.api.nvim_create_user_command("CopyToPlayers", function()
os.execute(string.format("mkdir -p '%s'", targetPath))
local localPath = fs.getCurrentPath()
local picker = Snacks.picker.get({ source = "explorer" })
local localPath = picker[1]:current().file
local targetFilePath = vim.fs.joinpath(targetPath, vim.fn.fnamemodify(localPath, ":t"))
os.execute(string.format("ln -s '%s' '%s'", localPath, targetFilePath))