Skip to content

Commit 0cf3855

Browse files
committed
Merge branch 'develop'
2 parents 4c4dc22 + 5e3bbd5 commit 0cf3855

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

core/aliases.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ 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)
9392

9493
sublime.set_timeout_async(remove)
9594

@@ -166,7 +165,7 @@ def delete_alias_file(alias, real_syntax):
166165
for view in window.views():
167166
syntax = view.settings().get("syntax")
168167
if syntax and syntax == alias_resource:
169-
view.assign_syntax(real_syntax)
168+
view.settings().set("syntax", real_syntax)
170169

171170
# delete the alias syntax asynchronously, after ST applied real syntax
172171
def remove():

core/settings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .overlay import with_ignored_overlay
88
from .utils.decorators import debounce
99
from .utils.logging import log
10-
from .utils.path import PACKAGE_NAME
10+
from .utils.path import PACKAGE_NAME, OVERLAY_ROOT
1111

1212
PACKAGE_SETTINGS = "A File Icon.sublime-settings"
1313
USER_SETTINGS = "Preferences.sublime-settings"
@@ -41,6 +41,7 @@ def clear_listener():
4141
sublime.load_settings(USER_SETTINGS).clear_on_change(_uuid)
4242

4343

44+
@debounce(100)
4445
def _on_change_package():
4546
is_aliases_changed = False
4647
is_icons_changed = False
@@ -74,7 +75,9 @@ def _on_change_package():
7475
def _on_change_user():
7576
global _cached_packages
7677
settings = sublime.load_settings(USER_SETTINGS)
77-
packages = settings.get("ignored_packages")
78+
packages = settings.get("ignored_packages", [])
79+
if OVERLAY_ROOT in packages:
80+
packages.remove(OVERLAY_ROOT)
7881
if packages != _cached_packages:
7982
_cached_packages = packages
8083
themes.patch(_cached_settings, on_demand=True)

core/utils/path.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sublime
33

44
PACKAGE_NAME, *_ = __package__.split(".", 1)
5-
OVERLAY_ROOT = "{0} {1} {0}".format("zzz", PACKAGE_NAME)
5+
OVERLAY_ROOT = "{0} {1}".format("zzz", PACKAGE_NAME)
66

77

88
def makedirs(*args):
@@ -22,28 +22,24 @@ 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():
2925
return os.path.join(sublime.cache_path(), OVERLAY_ROOT)
3026

3127

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

3531

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

3935

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

4339

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

4743

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

plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def setup_overlay():
4444
overlay.enable_overlay()
4545

4646
# run delayed to prevent race condition with previous plugin_unloaded
47-
sublime.set_timeout_async(setup_overlay, overlay.IGNORE_DELAY)
47+
sublime.set_timeout_async(setup_overlay, 1000)
4848

4949
def plugin_unloaded():
5050
settings.clear_listener()

0 commit comments

Comments
 (0)