mirror of
https://github.com/wickedest/Mergely.git
synced 2026-04-05 10:28:35 +08:00
fix(scroll): fixed issue where first rhs scroll was unlinked
This commit is contained in:
@@ -45,6 +45,7 @@ CodeMirrorDiffView.prototype.init = function(el, options = {}) {
|
|||||||
gutters: (this.settings.line_numbers && [ 'merge', 'CodeMirror-linenumbers' ]) || [],
|
gutters: (this.settings.line_numbers && [ 'merge', 'CodeMirror-linenumbers' ]) || [],
|
||||||
};
|
};
|
||||||
this._vdoc = new VDoc({ _debug: this.settings._debug });
|
this._vdoc = new VDoc({ _debug: this.settings._debug });
|
||||||
|
this._linkedScrollTimeout = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeMirrorDiffView.prototype.unbind = function() {
|
CodeMirrorDiffView.prototype.unbind = function() {
|
||||||
@@ -701,11 +702,14 @@ CodeMirrorDiffView.prototype._scrolling = function({ side }) {
|
|||||||
// coming in 2s, so this will "link" scrolling the other editor to
|
// coming in 2s, so this will "link" scrolling the other editor to
|
||||||
// this editor until this editor stops scrolling and times out.
|
// this editor until this editor stops scrolling and times out.
|
||||||
this._skipscroll[oside] = true;
|
this._skipscroll[oside] = true;
|
||||||
if (this._linkedScrollTimeout) {
|
trace('scroll#set oside skip set:', oside, this._skipscroll);
|
||||||
clearTimeout(this._linkedScrollTimeout);
|
if (this._linkedScrollTimeout[oside]) {
|
||||||
|
clearTimeout(this._linkedScrollTimeout[oside]);
|
||||||
|
trace('scroll#clearing timeout:', this._skipscroll);
|
||||||
}
|
}
|
||||||
this._linkedScrollTimeout = setTimeout(() => {
|
this._linkedScrollTimeout[oside] = setTimeout(() => {
|
||||||
this._skipscroll[oside] = false;
|
this._skipscroll[oside] = false;
|
||||||
|
trace('scroll#set oside skip unset:', oside, this._skipscroll);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
const top = top_to - top_adjust;
|
const top = top_to - top_adjust;
|
||||||
|
|||||||
Reference in New Issue
Block a user