fix(init): force redraw after deferred filetype retry

Problem: vim.cmd.redraw() (without bang) is a no-op when the screen is
not dirty. After invalidate_cache() sets tick=-1, Neovim has no reason
to redraw, so the decoration provider is never called, on_buf never
reparses, and the deferred syntax pass bails on the stale tick mismatch.

Solution: use vim.cmd('redraw!') which forces a full screen redraw
regardless of dirty state, ensuring on_buf fires, the cache is reparsed
with did_filetype()=0 resolved filetypes, and the deferred syntax pass
completes with a valid tick.
This commit is contained in:
Barrett Ruth 2026-03-04 14:01:38 -05:00
parent e02fff2b24
commit 7fddcd8882
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -343,7 +343,7 @@ local function ensure_cache(bufnr)
if vim.api.nvim_buf_is_valid(bufnr) and hunk_cache[bufnr] then
dbg('retrying filetype detection for buffer %d (was blocked by did_filetype)', bufnr)
invalidate_cache(bufnr)
vim.cmd.redraw()
vim.cmd('redraw!')
end
ft_retry_pending[bufnr] = nil
end)