Detecting editor exit events in Sublime

 ̄綄美尐妖づ 提交于 2019-12-11 07:47:15

问题


Is there a way to detect editor exit event in Sublime 2?

It is not listed in the API reference and I've tried using EventListener.on_close, but that works only for detecting view closing, which is not what I need.

I just want to execute something before the editor exits, is that possible?


回答1:


There is no way to do this in ST2. In ST3, you could try to capture the exit command by using sublime_plugin.EventListener.on_window_command(), or possibly on_text_command() (not sure what kind of command exit is, probably do both for safety), but I've never tried it myself.



来源:https://stackoverflow.com/questions/27150846/detecting-editor-exit-events-in-sublime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!