Compare commits
4 Commits
37660abe64
...
e6a880d2a4
| Author | SHA1 | Date | |
|---|---|---|---|
| e6a880d2a4 | |||
| 9cb5e2087f | |||
| 20dc7da4e8 | |||
| 0413ecca4b |
@ -270,11 +270,15 @@ def get_settings():
|
|||||||
|
|
||||||
|
|
||||||
def get_resource(resource):
|
def get_resource(resource):
|
||||||
path = "Packages/MarkdownLivePreview/resources/" + resource
|
package_name = __package__ # Get the current package name dynamically
|
||||||
abs_path = os.path.join(sublime.packages_path(), "..", path)
|
path = "Packages/{}/resources/{}".format(package_name, resource)
|
||||||
|
# Original logic: check absolute path first (useful for unpacked development)
|
||||||
|
# Adjusted abs_path to use dynamic package_name
|
||||||
|
abs_path = os.path.join(sublime.packages_path(), package_name, "resources", resource)
|
||||||
if os.path.isfile(abs_path):
|
if os.path.isfile(abs_path):
|
||||||
with open(abs_path, "r") as fp:
|
with open(abs_path, "r") as fp:
|
||||||
return fp.read()
|
return fp.read()
|
||||||
|
# Fallback to sublime.load_resource (works for packed and unpacked)
|
||||||
return sublime.load_resource(path)
|
return sublime.load_resource(path)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user