diff --git a/lua/oil/view.lua b/lua/oil/view.lua index 24a42f7..bc21dfb 100644 --- a/lua/oil/view.lua +++ b/lua/oil/view.lua @@ -911,8 +911,6 @@ local pending_renders = {} --- refetch nil|boolean Defaults to true ---@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( @@ -928,6 +926,7 @@ M.render_buffer_async = function(bufnr, opts, caller_callback) opts = vim.tbl_deep_extend("keep", opts or {}, { refetch = true, }) + ---@cast opts -nil if bufnr == 0 then bufnr = vim.api.nvim_get_current_buf() end