Skip to content

Commit

Permalink
ufo: add provider_selector, use treesitter as main provider
Browse files Browse the repository at this point in the history
re-introducing the `provider_selector` setting which encountered issues
with a previous version. Though is the idiomatic and cleaner way to
achieve the desired result.
  • Loading branch information
ttytm committed Sep 6, 2024
1 parent b94681f commit 0e58a3c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lua/nxvim/plugins/ufo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ufo.setup({
default = { "imports", "comment" },
markdown = {},
git = {},
svelte = { "comment" },
NeogitStatus = {},
},
preview = {
Expand All @@ -26,15 +27,12 @@ ufo.setup({
},
},
enable_get_fold_virt_text = false,
})
-- ]

-- == [ Events ================================================================

nx.au({
"FileType",
pattern = { "markdown", "NeogitStatus" },
callback = function() ufo.detach() end,
provider_selector = function(bufnr, filetype, buftype)
for _, type in ipairs({ "markdown", "NeogitStatus" }) do
if filetype == type then return "" end
end
return { "treesitter", "indent" }
end,
})
-- ]

Expand Down

0 comments on commit 0e58a3c

Please sign in to comment.