From 1e6fa3b828b38bce75b65aaab0b568d69048e363 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Thu, 29 Feb 2024 21:00:09 +0100 Subject: [PATCH] Fix: Stop viewport syncer after the window closes --- sbs_compare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbs_compare.py b/sbs_compare.py index d56764e..d6069d5 100644 --- a/sbs_compare.py +++ b/sbs_compare.py @@ -725,7 +725,7 @@ def update_scroll( self, view1, view2, lastUpdated ): view1.set_viewport_position( view2.viewport_position(), False ) def run( self ): - if not self.window: + if not self.window.is_valid(): return if self.window.id() != sublime.active_window().id(): @@ -735,7 +735,7 @@ def run( self ): view1 = self.views[0] view2 = self.views[1] - if not view1 or not view2: + if not view1.is_valid() or not view2.is_valid(): return vecA = view1.viewport_position()