refactor!: restructure and document configuration

This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2025-03-06 05:30:47 -03:00
parent 4a02e072a7
commit f87f9995be
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
126 changed files with 957 additions and 590 deletions

View file

@ -0,0 +1,32 @@
---@type LazySpec
return {
"kevinhwang91/nvim-ufo",
opts = {
provider_selector = function(_, filetype, _)
---@type table<string, UfoProviderEnum | UfoProviderEnum[]>
local ftDefaults = {
cs = "treesitter",
}
local function handleFallbackException(bufnr, err, providerName)
if type(err) == "string" and err:match "UfoFallbackException" then
return require("ufo").getFolds(bufnr, providerName)
else
return require("promise").reject(err)
end
end
return ftDefaults[filetype]
or function(bufnr)
return require("ufo")
.getFolds(bufnr, "lsp")
:catch(function(err)
return handleFallbackException(bufnr, err, "treesitter")
end)
:catch(function(err)
return handleFallbackException(bufnr, err, "indent")
end)
end
end,
},
}