Adds CopyToPlayers command

This commit is contained in:
Michel Fedde 2025-02-10 21:45:22 +01:00
parent 132f9d0636
commit 6f74d3b3db
8 changed files with 66 additions and 18 deletions

View file

@ -0,0 +1,19 @@
local fs = {}
local function startswith(string, start)
return string:sub(1, #start) == start
end
function fs.getCurrentPath()
local currentBuffer = vim.fn.expand("%")
if not startswith(currentBuffer, "neo-tree") then
return currentBuffer
end
local filesystemState = require("neo-tree.sources.manager").get_state("filesystem")
local currentLine = vim.fn.getpos(".")[2]
return filesystemState.tree:get_node(currentLine).path
end
return fs