From 6dcd9c0d8fcd8a37a1d2c25a087035bfe98cd1ab Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 20 Feb 2026 20:49:18 -0500 Subject: [PATCH] fix: add missing cast for opts in render_buffer_async Problem: LuaLS still warns at opts.refetch access because it does not track narrowing through opts = opts or {}. Solution: add ---@cast opts -nil after the guard, matching the same pattern used in util.render_text. --- lua/oil/view.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/oil/view.lua b/lua/oil/view.lua index a25917b..24a42f7 100644 --- a/lua/oil/view.lua +++ b/lua/oil/view.lua @@ -912,6 +912,7 @@ local pending_renders = {} ---@param caller_callback nil|fun(err: nil|string) M.render_buffer_async = function(bufnr, opts, caller_callback) opts = opts or {} + ---@cast opts -nil local function callback(err) if not err then vim.api.nvim_exec_autocmds(