Skip to content

Commit

Permalink
check if view is valid after debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
predragnikolic committed Aug 19, 2023
1 parent a56d7e8 commit 96ba832
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def schedule(self) -> None:
sublime.set_timeout(lambda: self.run_when_stable(cursors), 50)

def run_when_stable(self, cursors_to_compare: List[sublime.Region]) -> None:
if not self.view.is_valid():
return
if self.last_cursors != cursors_to_compare:
return
cursors = self.last_cursors
Expand Down

0 comments on commit 96ba832

Please sign in to comment.