From 572d8de8ef4c2a409609b248a8f11f2b4714048e Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 15 Mar 2022 14:05:56 +1000 Subject: [PATCH] Fix scrollbar jumping to the top when no difference in editors --- diff_edit/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff_edit/__init__.py b/diff_edit/__init__.py index 96e413f..1ab520d 100755 --- a/diff_edit/__init__.py +++ b/diff_edit/__init__.py @@ -211,7 +211,7 @@ class DiffEditor: fraction = (y - left_start) / (left_end - left_start) other_y = round(right_start + fraction * (right_end - right_start)) return other_y - 1 if other_y == len(self.editors[1].text_widget) else other_y - return 0 + return y def follow_scroll(self): x, y = self.editors[0].scroll_position