Guard against detached views `on_pre_close`
@@ -64,6 +64,9 @@ class UpdateState(sublime_plugin.EventListener):
def on_pre_close(self, view):
window = view.window()
+ # If the user closes the window and not *just* a view, the view is
+ # already detached, hence we check.
+ if window:
sublime.set_timeout_async(lambda: fill_panel(window, update=True))
