Skip to content

Commit

Permalink
Detect closed panels
Browse files Browse the repository at this point in the history
This prevents exceptions being logged every time a panel is closed as
they don't seem to trigger on_close.
  • Loading branch information
mheinzler committed Nov 14, 2017
1 parent 36cd29e commit e5127c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions trailing_spaces.py
Expand Up @@ -484,6 +484,12 @@ def on_close(self, view):
active_views.pop(view.id(), None)

def update_view_on_scroll(self, view):
# panel views don't trigger on_close but are also not valid anymore
# after being hidden, so try to detect these cases here
if view.size() == 0 and view.file_name():
active_views.pop(view.id(), None)
return

# compare the currently visible region to the previous (if any) and
# update if there were changes
if view.visible_region() != active_views.get(view.id(), view.visible_region()):
Expand Down

0 comments on commit e5127c6

Please sign in to comment.