winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

'Automatically scroll to first difference' does not work for pasted content

Open dcog989 opened this issue 6 months ago • 4 comments

What is happening

  1. WinMerge > CTRL+N
  2. paste a long block of text (longer than viewport) in first pane
  3. focus second pane by clicking on it and paste amended text (some lines at top of text changed)
  4. the second pane now scrolls to the last line of content

What I'd like to happen

...the second pane should scroll up to the first difference, or if identical scroll to top and synchronize with first pane.

dcog989 avatar May 16 '25 12:05 dcog989

"Automatically scroll to first difference" is not intended to work with manually pasted content. Instead, please try using the "File → Open Clipboard" menu, which uses clipboard history

sdottaka avatar May 17 '25 02:05 sdottaka

is not intended to work

I don't understand. You don't want to make this work? It would be a big enhancement for everyone.

try using the "File → Open Clipboard"

That doesn't help when it's clip#3 and clip#4

dcog989 avatar May 17 '25 11:05 dcog989

I understand why you might expect "Automatically scroll to first difference" to work after pasting content from the clipboard. However, this option is currently only designed to work when loading files.

Making it work for pasted content could lead to unexpected behavior or significantly increase complexity.

Personally, I think WinMerge should add a feature to open clipboard history entries — not just the latest two — as files. Once that is implemented, the "Automatically scroll to first difference" option would likely work as expected. (Though, to be honest, that might not happen anytime soon.)

sdottaka avatar May 18 '25 23:05 sdottaka

Hi. I understand. It's just a constant irritation for me because it's how I usually use WinMerge.

I was playing with the code a couple of days ago to see what a solution might look like - although I hit some build issues so didn't get it working.

If I can get a PR working and the code isn't too horrible, would you be interested?

dcog989 avatar May 19 '25 10:05 dcog989