rkitover / vimpager

Use Vim as PAGER
http://www.vim.org/scripts/script.php?script_id=1723
Other
769 stars 72 forks source link

Weird behaviour when scrolling horizontal in "git diff" #269

Open prurigro opened 1 year ago

prurigro commented 1 year ago

Hi! I finally upgraded to 2.x after years of holding off with 1.8.9, and I think I have pretty much everything working well again except for some strange behaviour in git diff when I've scrolled horizontally.

Everything starts out lined up, but scroll a few columns right and the unchanged text scrolls as expected while everything else stays fixed against the edge of the buffer. Scroll a few more columns right and the old text begins to scroll correctly while the new text continues to stay fixed against the edge of the buffer. Eventually everything starts scrolling correctly, but the old and new lines aren't lined up, which makes spotting the differences difficult.

I realize my description might be a bit hard to parse, so I've included some screenshots to show what I mean:

Not scrolled at all: 1

Scrolled a few lines right and the unchanged text shifts while the rest stays fixed: 2

Scrolled a few more lines right and everything but the changed text starts to scroll correctly: 3

Scrolled a bunch of additional lines right and now everything is scrolling correctly but not lined up: 4

prurigro commented 1 year ago

I just confirmed the same behaviour exists with a vanilla vim install with only the pathogen and vimpager plugins, and let g:vimpager.passthrough = 0 and set nowrap settings.

I also noticed that while the same issue obviously doesn't exist with set nowrap, the column the text breaks on is dramatically different between the + and - rows (including when there are no changes before the break).