Weird, identical lines are highlighted in the Merge View

Hi Marijin,

I’m trying to diff changes and show a merge view via “@codemirror/merge”. But it seems that identical lines are showing as changes.
See this example, only line 7 is changed and the rest of lines are identical. But all lines after line 7 are highlighted as changes.
I inspected the css class of dom elements and all those lines are marked as “cm-changedLine”.

Can you provide those inputs as text (for example via gist.github.com)? If there is only one changed line, the lines below should definitely not be shown as different. (However, if the files are very big and there are multiple changed lines, chunks between them may be shown as changed because the differ could not manage to compute a more precise diff in a reasonable time.)

Thanks for quick reply, @marijn! I tried to test it for many times and confirmed it’s caused by too many lines (5000+ lines).
It’s working after I set the ScanLimit: diffConfig: { scanLimit: 10000 }

But i don’t understand what value should be more reasonable for the ScanLimit. Should it be the maximum number of lines?

scanLimit is counted in characters. It provides a maximum size above which chunks are not further divided with a precise algorithm, only a cruder one that may miss unchanged parts.

I see… a maximum value per each diff chunk. Thanks so much! :pray: :pray: :pray: