This commit uses a more robust algorithm to determine ST paths at startup,
which no longer relies on Default.sort module.
It fixes an issue, which caused {st_dir}/Packages path detection to fail, if
Default package is extracted to {data}/Packages by end users.
To determine default package path, it first tries sublime.executable_path(),
which returns valid paths at import time on ST4088+ or with mocked ST API
in CI environments. When running on ST3, abspath(sys.executable) is used
instead to return plugin_host's absolute path. Without it, sys.executable
only returns "python" on ST3's plugin_host.
Fix path detection algorithm
This commit uses a more robust algorithm to determine ST paths at startup, which no longer relies on
Default.sort
module.It fixes an issue, which caused {st_dir}/Packages path detection to fail, if Default package is extracted to {data}/Packages by end users.
To determine default package path, it first tries
sublime.executable_path()
, which returns valid paths at import time on ST4088+ or with mocked ST API in CI environments. When running on ST3,abspath(sys.executable)
is used instead to return plugin_host's absolute path. Without it,sys.executable
only returns "python" on ST3's plugin_host.