From 235617bacf8fbb63b7336a8f3d0e50e26d442cde Mon Sep 17 00:00:00 2001 From: Alexander Garcia Date: Thu, 30 Mar 2023 16:05:44 -0400 Subject: [PATCH] fix(update_show_deleted): show_deleted when buffer not in cache --- lua/gitsigns/manager.lua | 2 +- teal/gitsigns/manager.tl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/gitsigns/manager.lua b/lua/gitsigns/manager.lua index 6d7df375..2e86d709 100644 --- a/lua/gitsigns/manager.lua +++ b/lua/gitsigns/manager.lua @@ -271,7 +271,7 @@ local function update_show_deleted(bufnr) clear_deleted(bufnr) if config.show_deleted then - for _, hunk in ipairs(bcache.hunks) do + for _, hunk in ipairs(bcache.hunks or {}) do M.show_deleted(bufnr, ns_rm, hunk) end end diff --git a/teal/gitsigns/manager.tl b/teal/gitsigns/manager.tl index bba5363a..05e8739e 100644 --- a/teal/gitsigns/manager.tl +++ b/teal/gitsigns/manager.tl @@ -271,7 +271,7 @@ local function update_show_deleted(bufnr: integer) clear_deleted(bufnr) if config.show_deleted then - for _, hunk in ipairs(bcache.hunks) do + for _, hunk in ipairs(bcache.hunks or {}) do M.show_deleted(bufnr, ns_rm, hunk) end end