Error highlighting entire document and no differences

Hello,

I am currently working on a project and we came across an issue which we do not know how to resolve. We are updating the viewport with CodeMirror.MergeView. The code will be fully highlighted regardless of differences or not until we select one of the panels and start to type. As soon as you type or add a space the highlighting corrects is self. We also noticed that it works on Mac but not on Windows computers even though it is browser based.

If more information is needed I would be glad to explain in more detail.
Thanks!

Could it be that you’re initializing the merge view at a point where it isn’t visible in the DOM yet? If so, that might prevent it from realizing which part of the code is visible, and applying the diff markings (which I assume is what you’re talking about).

So for a little bit more background. When the page itself initializes the first set of code on both sides gets highlighted properly. At the top there are buttons to switch only the right side code. On push CodeMirror.Merge is called to update the right side only with new text. It is at that point that the highlighting breaks. The DOM should be able to see everything properly.

Thanks!

Any help with this would be great. Not sure if it went unnoticed that’s why I am posting again.

Thanks in advance!

I don’t know what’s happening here, so you’ll have to debug it yourself.

From what I am explaining though it should be working correct? And okay no worries thanks!