Files
neovim/runtime/lua/vim
Lewis Russell ea878f456a fix(treesitter): ignore stale fold refresh callbacks
Problem:

The fold refresh path for foldminlines/foldnestmax creates a new
FoldInfo and starts an async parse. If FileType or BufUnload re-enters
before that callback returns, foldinfos[bufnr] can be cleared or
replaced. The callback then indexes a stale slot and raises an "attempt
to index a nil value" error.

Solution:

Capture the FoldInfo created for the refresh and carry that object
through the async callback. Before calling foldupdate(), verify that the
buffer still points at the same FoldInfo generation; otherwise ignore
the stale callback.

AI-assisted: Codex

Fixes #38461
2026-03-25 16:12:52 +00:00
..
2026-03-11 18:24:57 +01:00
2025-06-06 15:36:48 +01:00
2026-01-09 10:07:15 +01:00
2026-03-11 18:00:18 +01:00
2026-03-11 18:00:18 +01:00
2025-09-16 11:41:36 +08:00