1
0
mirror of synced 2025-12-26 17:38:23 +08:00

Fixed initialization problem where scroll to first change did not work

This commit is contained in:
Jamie Peabody
2015-11-09 09:21:38 +00:00
parent 8883235daa
commit 21bd63961b

View File

@@ -921,7 +921,7 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
this.trace('change', 'diff time', timer.stop());
this.changes = Mgly.DiffParser(d.normal_form());
this.trace('change', 'parse time', timer.stop());
if (this._current_diff === undefined) {
if (this._current_diff === undefined && this.changes.length) {
// go to first difference on start-up
this._current_diff = 0;
this._scroll_to_change(this.changes[0]);