$('#mergely').mergely('lhs', Array(100).join("This is a test 1\n"));
$('#mergely').mergely('rhs', Array(100).join("This is a test 2\n"));
It should scroll to the bottom. While scrolled to the bottom, run this line
$('#mergely').mergely('lhs', Array(10).join("This is a test 3\n"));
It will throw this error
mergely.min.js:6 Uncaught TypeError: Cannot read property 'replace' of undefined
at new Mgly.LCS (mergely.min.js:6)
at Mgly.CodeMirrorDiffView._markup_changes (mergely.min.js:7)
at Mgly.CodeMirrorDiffView._scrolling (mergely.min.js:6)
at mergely.min.js:6
at CodeMirror.signal (codemirror.min.js:7)
at HTMLDivElement.<anonymous> (codemirror.min.js:3)
The error only seems to be thrown if the new text doesn't reach the point the editor is currently scrolled to.
I've reproduced this in Chrome and Firefox. The above error message is from Chrome.
The issue in my use case is that this is then getting caught by the window.onerror handler, leading to a warning that an operation has failed.
On the demo page, http://www.mergely.com/editor, open the console and run these lines to populate the editors.
It should scroll to the bottom. While scrolled to the bottom, run this line
It will throw this error
The error only seems to be thrown if the new text doesn't reach the point the editor is currently scrolled to. I've reproduced this in Chrome and Firefox. The above error message is from Chrome. The issue in my use case is that this is then getting caught by the window.onerror handler, leading to a warning that an operation has failed.