WIP: Move to vim.lsp

This commit is contained in:
Dennis Schoepf 2025-04-09 18:40:28 +02:00
parent 0b367e1656
commit d3945cc621
9 changed files with 348 additions and 41 deletions

View file

@ -9,6 +9,26 @@ vim.api.nvim_create_autocmd("TextYankPost", {
pattern = "*",
})
function root_pattern(...)
local patterns = M.tbl_flatten({ ... })
return function(startpath)
startpath = M.strip_archive_subpath(startpath)
for _, pattern in ipairs(patterns) do
local match = M.search_ancestors(startpath, function(path)
for _, p in ipairs(vim.fn.glob(table.concat({ escape_wildcards(path), pattern }, "/"), true, true)) do
if vim.loop.fs_stat(p) then
return path
end
end
end)
if match ~= nil then
return match
end
end
end
end
local function filter(arr, fn)
if type(arr) ~= "table" then
return arr