Detecting editor exit events in Sublime

2019-08-05 18:39发布

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条回答
来,给爷笑一个
2楼-- · 2019-08-05 19:05

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.

查看更多
登录 后发表回答