Closed ofseed closed 4 months ago
Scroll-bind window synchronization should be handled by nvim IMO. However, as a workaround, you can use the following autocmd to fix this (for fugitive blame window):
vim.api.nvim_create_autocmd('FileType', {
desc = 'Set local options for fugitive blame buffers.',
group = vim.api.nvim_create_augroup('FugitiveSettings', {}),
pattern = 'fugitiveblame',
callback = function()
local win_alt = vim.fn.win_getid(vim.fn.winnr('#'))
vim.opt_local.winbar = vim.api.nvim_win_is_valid(win_alt)
and vim.wo[win_alt].winbar ~= ''
and ' '
or ''
end,
})
Problem
When
scrollbind
is set, we expect that every line of the two windows has a line-to-line relationship, but if one window's winbar is enabled while the other is not, we lose the relationship.For example, for git blame plugins, the right window shows the file, and the left window shows its corresponding blame information for every line. The line-to-line relation will be broken if the right window has a
winbar
while the left window does not.fugitive.vim
:Git blame
gitsigns.nvim
:Gitsigns blame
Expected behavior
If one of the two
scrollbind
windows has the dropbar enabled, the other must be enabled too.