Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When scrolling line by line, the blame window does not scroll with the main window #1071

Open
ofseed opened this issue Jun 25, 2024 · 3 comments
Labels
bug Something isn't working upstream issue Issue/limitation of Neovim core

Comments

@ofseed
Copy link
Contributor

ofseed commented Jun 25, 2024

Description

:Gitsigns blame add gaps to the main window when the diff is smaller than two lines. I found that when scrolling line by line using j or <C-e>, the blame window will not follow the scroll when the one gap is scrolled out of the screen.

_20240625_203753.webm

Neovim version

NVIM v0.11.0-dev-3461+g9e436251d (latest master currently)

Operating system and version

6.9.6-arch1-1

Expected behavior

The two windows should scroll together and be always aligned.

Actual behavior

If it is a gap rather than a line of text be scrolled out the screen, the blame window will not be scroll following the main window.

Minimal config

for name, url in pairs{
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} do
local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
end
vim.opt.runtimepath:append(install_path)
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
  -- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. Clone gitsigns.nvim
  2. Create minimal.lua in place and save it after copying its content
  3. Open a file of the gitsigns.nvim repo by nvim -u minimal.lua lua/gitsigns.lua
  4. Scroll line by line

Gitsigns debug messages

No response

Gitsigns cache

No response

@ofseed ofseed added the bug Something isn't working label Jun 25, 2024
@lewis6991
Copy link
Owner

lewis6991 commented Jun 25, 2024

Gitsigns just uses set scrollbind in each window. This is probably a limitation of virtual_lines in Neovim. I don't think we can fix that here.

@lewis6991 lewis6991 added the upstream issue Issue/limitation of Neovim core label Jun 25, 2024
@ofseed
Copy link
Contributor Author

ofseed commented Jun 25, 2024

I also guessed that it might be an upstream problem, but there will not be this issue when just using diff-mode, which utilizes set scrollbind too. I have no idea how to make it work properly.

@lewis6991
Copy link
Owner

Diff mode doesn't use extmarks and injects filler lines directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream issue Issue/limitation of Neovim core
Projects
None yet
Development

No branches or pull requests

2 participants