From 775add9b154b9e174d42ac2f176c76b6bb4f15be Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Thu, 30 Apr 2026 07:24:42 +0200 Subject: [PATCH] fix(git): keep URI buffers loaded so jumplist entries stay valid --- lua/git/object.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lua/git/object.lua b/lua/git/object.lua index bbd5a44..2ff9cc3 100644 --- a/lua/git/object.lua +++ b/lua/git/object.lua @@ -175,11 +175,7 @@ function M.read_uri(buf) vim.b[buf].git_worktree = worktree vim.bo[buf].swapfile = false - -- `unload` frees content when the buffer is hidden, but keeps the - -- bufnr in the buffer list so the jumplist's `(bufnr, line, col)` - -- entries stay valid. `` back to a hidden URI buffer triggers - -- the BufReadCmd again, refreshing content via `cat-file -p`. - vim.bo[buf].bufhidden = "unload" + vim.bo[buf].bufhidden = "hide" ---@type string? local stdout = pending_content[buf]