1

I'm trying to develop some plugin for SublimeText3.

The plugin use a node.js server, and I want it keep running as a single instance(service).

So, what I would design the plugin is

to try TCP connect on the plugin load, and

  • if the connection succeeded and received data, do nothing
  • if the connection failed, execute the node command to launch the new server instance

However, I cannot find any EventListener for plugin-onload Here

https://www.sublimetext.com/docs/3/api_reference.html

What is the common manner to achieve what I would like to do in SublimeText Plugin??

Please let me know. Thanks.

4

1 回答 1

1

你可以定义一个名为plugin_loaded的函数,里面的代码会在插件加载的时候执行

def plugin_loaded():
    # your code here
于 2013-09-30T18:41:44.197 回答