fix(git): stop the blame statuscolumn leaking into new windows

This commit is contained in:
2026-05-26 14:02:37 +02:00
parent 872431be3c
commit d81cf95b48
2 changed files with 52 additions and 9 deletions
+26
View File
@@ -450,6 +450,32 @@ t.test("overlay re-budgets when a gutter option changes", function()
end, "the blame to re-budget for the widened signcolumn")
end)
t.test("the overlay statuscolumn does not leak into other windows", function()
local _, buf = setup("a\nb\nc\n")
vim.api.nvim_set_current_buf(buf)
blame.toggle_overlay(buf)
t.wait_for(function()
local s = blame.state(buf)
return s ~= nil and s.blame_width ~= nil
end, "the overlay to render")
t.falsy(
vim.go.statuscolumn:find("git.blame", 1, true),
"the overlay leaves the global statuscolumn untouched"
)
vim.cmd("new")
local plain = vim.api.nvim_get_current_win()
t.defer(function()
if vim.api.nvim_win_is_valid(plain) then
vim.api.nvim_win_close(plain, true)
end
end)
t.falsy(
vim.wo[plain].statuscolumn:find("git.blame", 1, true),
"a new window does not inherit the blame gutter"
)
end)
t.test("overlay gutter shows sha, author and an absolute date", function()
local _, buf = setup("a\nb\nc\n")
vim.api.nvim_set_current_buf(buf)