How to save project state before exiting in ST3 on Windows?

半腔热情 提交于 2019-12-11 20:22:09

问题


The SublimeRestart plugin restarts ST3 on Windows like this:

subprocess.call('taskkill /im sublime_text.exe /f && cmd /C "'+ os.path.join(os.getcwd(), 'sublime_text.exe') + '"', shell=True)

[Full code] The problem is, when Sublime restarts, the active project is the one from the last time Sublime was properly exited.

Changing it to

self.window.run_command('exit')
subprocess.call(os.path.join(os.getcwd(), 'sublime_text.exe'))

[Full code] causes it to hang for 20-30 seconds before exiting, and then does not restart it at all.

Is there a way to do something like this?

self.window.run_command('save_current_project_state')
subprocess.call('taskkill /im sublime_text.exe /f && cmd /C "'+ os.path.join(os.getcwd(), 'sublime_text.exe') + '"', shell=True)

Or to just handle this in a different way?

Thanks.

来源:https://stackoverflow.com/questions/27770401/how-to-save-project-state-before-exiting-in-st3-on-windows

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