Closed Thom1729 closed 5 years ago
Thanks for the work.
Adding a sublime_lib dependency is outside the scope of this PR.
I agree.
Thomas, I have added you as a collaborator because you have some better understanding of some part of the code than I do. It's okay if you don't want to be a collaborator though.
In
reload_plugin
,os.listdir
was used to find top-level plugins. This fails when the package in question is zipped (such as an installed package). Ordinarily, this wouldn't matter, because reloading is triggered when you edit a package file (which is by definition not zipped). However, there are two situations in which this could fail:In either case,
os.listdir
will raiseFileNotFoundError
.This PR uses
sublime.find_resources
instead ofos.listdir
to find top-level plugin scripts. It should cover both these cases. Outside these cases, there should be no change in behavior.Note:
posixpath
is used to manipulate the resource paths. This should be correct regardless of the underlying platform. As an alternative, I suggest thatsublime_lib.ResourcePath
might help to simplify this logic and a good deal of other path-related logic in this package. Adding asublime_lib
dependency is outside the scope of this PR.