Skip to content

Commit

Permalink
Fix: Stop viewport syncer after the window closes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed Feb 29, 2024
1 parent 4611297 commit 1e6fa3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sbs_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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()
Expand Down

0 comments on commit 1e6fa3b

Please sign in to comment.