Sublime Forum

ST3: missing sublime.package_path() at the startup

#1

When I start Sublime Text 3 3033, my plugin throws error.
I found it is because sublime.packages_path() returns nothing on initialization step.
After “reloading plugin” step, sublime.packages_path() works fine.
Thanks.

0 Likes

#2

From the ST3 docs

Plugin Lifecycle

At importing time, plugins may not call any API functions, with the exception of sublime.version(), sublime.platform(), sublime.architecture() and sublime.channel().

If a plugin defines a module level function plugin_loaded(), this will be called when the API is ready to use. Plugins may also define plugin_unloaded(), to get notified just before the plugin is unloaded.

0 Likes

#3

I should have read through the ST3 reference before posting.
Thanks for quick responding, skuroda!

0 Likes