diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2026-03-24 15:46:56 +0000 |
|---|---|---|
| committer | Lewis Russell <me@lewisr.dev> | 2026-03-25 16:12:52 +0000 |
| commit | ea878f456a8b15381ce215b6e53781b0a061c5f4 (patch) | |
| tree | 40a903bde347063f7336c185f6bae9cd2a0dc029 /scripts/lintcommit.lua | |
| parent | b233f71b1bd688363d3efd8f550dbf44cc4e841c (diff) | |
| download | rneovim-ea878f456a8b15381ce215b6e53781b0a061c5f4.tar.gz rneovim-ea878f456a8b15381ce215b6e53781b0a061c5f4.tar.bz2 rneovim-ea878f456a8b15381ce215b6e53781b0a061c5f4.zip | |
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
Diffstat (limited to 'scripts/lintcommit.lua')
0 files changed, 0 insertions, 0 deletions