Skip to content

Commit 60e179e

Browse files
committed
Revert "Move overlay to Cache directory"
This reverts commit 1052bf7. Due to resources within Cache/ being loaded before Packages/, alias syntaxes' file extension specifications didn't always take desired precedence over default syntaxes. Hence overlay package location needs to be reverted, to ensure expected icons to be displayed. Example: Python/Python.sublime-syntax is assigned to ".bzl" file extension. A File Icon ships a Python (Bazel).sublime-syntax with a dedicated source.bazel scope associated with ".bzl" extension as well. For the latter to take precedence, it must be loaded after Python, which isn't the case, when located in Cache/, regardless the "zzz A File Icon" package name.
1 parent 1cb9584 commit 60e179e

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

core/aliases.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def delete_alias_files(syntaxes):
8989

9090
def remove():
9191
shutil.rmtree(path.overlay_aliases_path(), ignore_errors=True)
92+
shutil.rmtree(path.overlay_cache_path(), ignore_errors=True)
9293

9394
sublime.set_timeout_async(remove)
9495

core/utils/path.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,28 @@ def package_icons_path():
2222

2323

2424
def overlay_path():
25+
return os.path.join(sublime.packages_path(), OVERLAY_ROOT)
26+
27+
28+
def overlay_cache_path():
2529
return os.path.join(sublime.cache_path(), OVERLAY_ROOT)
2630

2731

2832
def overlay_aliases_path(file_name=""):
29-
return os.path.join(sublime.cache_path(), OVERLAY_ROOT, "aliases", file_name)
33+
return os.path.join(sublime.packages_path(), OVERLAY_ROOT, "aliases", file_name)
3034

3135

3236
def overlay_patches_path():
33-
return os.path.join(sublime.cache_path(), OVERLAY_ROOT, "patches")
37+
return os.path.join(sublime.packages_path(), OVERLAY_ROOT, "patches")
3438

3539

3640
def overlay_patches_general_path():
37-
return os.path.join(sublime.cache_path(), OVERLAY_ROOT, "patches", "general")
41+
return os.path.join(sublime.packages_path(), OVERLAY_ROOT, "patches", "general")
3842

3943

4044
def overlay_patches_specific_path():
41-
return os.path.join(sublime.cache_path(), OVERLAY_ROOT, "patches", "specific")
45+
return os.path.join(sublime.packages_path(), OVERLAY_ROOT, "patches", "specific")
4246

4347

4448
def overlay_aliases_resource_path(file_name=""):
45-
return "Cache/{}/aliases/{}".format(OVERLAY_ROOT, file_name)
49+
return "Packages/{}/aliases/{}".format(OVERLAY_ROOT, file_name)

0 commit comments

Comments
 (0)