Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot
8075912b1b chore(release): 5.4.7 [skip ci]
## [5.4.7](https://github.com/wickedest/Mergely/compare/v5.4.6...v5.4.7) (2026-02-28)

### Bug Fixes

* **#228:** Fixes issue where a single scroll event would cause multiple updates and calculate view placement incorrectly ([9834f09](9834f0964a))
2026-02-28 09:05:39 +00:00
Jamie Peabody
9834f0964a fix(#228): Fixes issue where a single scroll event would cause multiple updates and calculate view placement incorrectly 2026-02-28 09:04:47 +00:00
4 changed files with 14 additions and 15 deletions

View File

@@ -1,3 +1,10 @@
## [5.4.7](https://github.com/wickedest/Mergely/compare/v5.4.6...v5.4.7) (2026-02-28)
### Bug Fixes
* **#228:** Fixes issue where a single scroll event would cause multiple updates and calculate view placement incorrectly ([9834f09](https://github.com/wickedest/Mergely/commit/9834f0964abeac88a4af83cde40b1deb29b8fe5d))
## [5.4.6](https://github.com/wickedest/Mergely/compare/v5.4.5...v5.4.6) (2026-02-24)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "mergely",
"version": "5.4.6",
"version": "5.4.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mergely",
"version": "5.4.6",
"version": "5.4.7",
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
"devDependencies": {
"@babel/core": "^7.1.6",

View File

@@ -1,6 +1,6 @@
{
"name": "mergely",
"version": "5.4.6",
"version": "5.4.7",
"description": "A javascript UI for diff/merge",
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
"author": {

View File

@@ -130,7 +130,6 @@ CodeMirrorDiffView.prototype.scrollToDiff = function(direction) {
this.trace('change', 'current-diff', this._current_diff);
// _current_diff changed, refresh the view
this._scroll_to_change(this.changes[this._current_diff]);
this.setChanges(this.changes);
};
CodeMirrorDiffView.prototype.mergeCurrentChange = function(side) {
@@ -149,7 +148,6 @@ CodeMirrorDiffView.prototype.scrollTo = function(side, num) {
const ed = this.editor[side];
ed.setCursor(num);
ed.centerOnCursor();
this._renderChanges();
this.el.dispatchEvent(new Event('updated'));
};
@@ -556,20 +554,12 @@ CodeMirrorDiffView.prototype._scroll_to_change = function(change) {
if (!change) {
return;
}
const {
lhs: led,
rhs: red
} = this.editor;
// set cursors
const llf = Math.max(change['lhs-line-from'], 0);
const rlf = Math.max(change['rhs-line-from'], 0);
led.setCursor(llf, 0);
red.setCursor(rlf, 0);
if (change['lhs-line-to'] >= 0) {
this.scrollTo('lhs', change['lhs-line-to']);
} else if (change['rhs-line-to'] >= 0) {
this.scrollTo('rhs', change['rhs-line-to']);
}
const { lhs: led } = this.editor;
led.focus();
};
@@ -1185,7 +1175,9 @@ CodeMirrorDiffView.prototype._renderDiff = function(changes) {
ctx_rhs.fillRect(1.5, rfrom, 4.5, rto);
this._handleLhsMarginClick = function (ev) {
const y = ev.pageY - ex.lhs_xyoffset.top - (lto / 2);
// `top` accounts for the editor starting at position other than 0 on page
const { top } = ev.currentTarget.offsetParent.getBoundingClientRect();
const y = (ev.pageY - top) - ex.lhs_xyoffset.top - (lto / 2);
const sto = Math.max(0, (y / mcanvas_lhs.height) * ex.lhs_scroller.scrollHeight);
ex.lhs_scroller.scrollTo({ top: sto });
};