fix(indent): don't render scopes in closed folds. Fixes #352

This commit is contained in:
Folke Lemaitre 2024-12-19 08:47:31 +01:00
parent c62e7a2561
commit 94ec5686a6
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -219,6 +219,11 @@ function M.on_win(win, buf, top, bottom)
local state = get_state(win, buf, top, bottom)
local scope = scopes and scopes:get(win) --[[@as snacks.indent.Scope?]]
vim.api.nvim_buf_call(buf, function()
if scope and vim.fn.foldclosed(scope.from) ~= -1 then
scope = nil
end
end)
-- adjust top and bottom if only_scope is enabled
if config.indent.only_scope then