Keep the current line in the view when resizing with line-wrap on in TortoiseGitMerge
What steps will reproduce the problem?
- Diff a file which is "tall" and "wide" (many lines, and long lines)
- Turn on "Wrap Lines" so "wide" lines of text which don't fit horizontally are wrapped to the next line
- Scroll down to the middle of the document, note where you are in the document (line number)
- Change the width of the window (most obvious when switching to/from maximized)
- Note that your position in the document changes wildly, and you lose your place
- Experience sadness
What is the expected output? What do you see instead?
I expect changing window width to not effect the current vertical position in the file. The top line (and line number) that I can see should not change.
What version of TortoiseGit and Git are you using? On what operating system?
- TortoiseGitMerge 2.11.0.0 - 64 Bit, Oct 10 2020
- On Windows 10 Pro (version 2004 build 19041.746)
Please provide any additional information below.
If you implement this, there will be an edge case when the top visible line is a line-part. I think this fix would be great no matter how you handle that edge case. But ideally, I suggest maintaining position as "current visible line number" plus "current visible line parts". If the number of line parts becomes less than the previous "current visible line parts", then move to the highest existing line part.