fix(win): don't update title is relative win is invalid. Closes #1348

This commit is contained in:
Folke Lemaitre 2025-02-21 08:06:52 +01:00
parent 5fa93cb684
commit a00c323d4b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -615,6 +615,12 @@ function M:set_title(title, pos)
if not self:valid() then
return
end
-- Don't try to update if the relative window is invalid.
-- It will be fixed once a full update is done.
local relative_win = vim.api.nvim_win_get_config(self.win).win
if relative_win and not vim.api.nvim_win_is_valid(relative_win) then
return
end
vim.api.nvim_win_set_config(self.win, {
title = self.opts.title,
title_pos = self.opts.title_pos,