Skip to content

Commit 09b5214

Browse files
committed
Unassign syntax before removing cache (#15)
1 parent 2b23bbb commit 09b5214

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

IconSupport.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ def patch_cpp_extensions(enable: boolean):
151151
os.remove(user_cpp_settings_path)
152152

153153

154+
def unassign_support_syntax() -> None:
155+
for w in sublime.windows():
156+
for v in w.views(include_transient=True):
157+
syntax = v.syntax()
158+
if not syntax: continue
159+
if not syntax.path: continue
160+
161+
if "Timeless Icon Support" in syntax.path:
162+
v.assign_syntax("scope:text.plain")
163+
164+
154165
def get_version_string(c_letters: bool) -> str:
155166
if c_letters:
156167
return "{}+c_letters".format(Version)
@@ -216,6 +227,8 @@ def write_file(path, contents):
216227

217228

218229
def remove_icon_support() -> None:
230+
unassign_support_syntax()
231+
219232
try:
220233
shutil.rmtree(get_timeless_icon_support_path(), ignore_errors=True)
221234
except:

0 commit comments

Comments
 (0)