【问题标题】:Detecting editor exit events in Sublime在 Sublime 中检测编辑器退出事件
【发布时间】:2014-11-26 13:47:02
【问题描述】:

有没有办法在 Sublime 2 中检测编辑器退出事件?

它没有在API reference 中列出,我尝试过使用EventListener.on_close,但这仅适用于检测视图关闭,这不是我需要的。

我只想在编辑器退出之前执行一些东西,可以吗?

【问题讨论】:

    标签: sublimetext2 sublimetext sublime-text-plugin


    【解决方案1】:

    在 ST2 中无法做到这一点。在 ST3 中,您可以尝试使用sublime_plugin.EventListener.on_window_command()on_text_command() 来捕获exit 命令(不确定exit 是什么类型的命令,可能为了安全起见),但我从未尝试过我自己。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-27
      • 2013-09-02
      • 2015-06-12
      • 2017-04-04
      相关资源
      最近更新 更多