Skip to content

Commit ed13882

Browse files
committed
fix: disable context plugins in diff buffers for scrollbind alignment
Disable nvim-treesitter-context and context.vim in diff buffers to prevent scrollbind misalignment. These plugins add virtual lines at the top of windows which interfere with synchronized scrolling.
1 parent 2843ba6 commit ed13882

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lua/diffview/vcs/file.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ File.create_buffer = async.wrap(function(self, callback)
292292
vim.cmd("filetype detect")
293293
end)
294294

295+
-- Disable context plugins that interfere with scrollbind alignment.
296+
vim.b[self.bufnr].ts_context_disable = true -- nvim-treesitter-context
297+
vim.b[self.bufnr].context_enabled = false -- context.vim
298+
295299
vim.bo[self.bufnr].modifiable = last_modifiable
296300
vim.bo[self.bufnr].modified = last_modified
297301
self:post_buf_created()

0 commit comments

Comments
 (0)