def clear_document_states(window: sublime.Window): if window.id() in document_states: del document_states[window.id()]