defensive cleaning, completely after last view
@@ -147,15 +147,20 @@ class Listener:
queue.cleanup(vid)
- # Remove bid from persist.errors if it's the last view on the buffer
bid = view.buffer_id()
buffers = []
+ view_count = 0
for w in sublime.windows():
for v in w.views():
+ view_count = view_count + 1
buffers.append(v.buffer_id())
- if buffers.count(bid) is 1:
- del persist.errors[bid]
+ if view_count <= 1:
+ # Wipe clean after last view closes
+ persist.errors.clear()
+ elif buffers.count(bid) <= 1:
+ # Remove bid from persist.errors if it's the last view on the buffer
+ persist.errors.pop(bid, None)
def on_hover(self, view, point, hover_zone):
"""On mouse hover event hook.
