Skip to content

Commit 81d5a5b

Browse files
Clean up
1 parent 3b9d917 commit 81d5a5b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cursorless-talon/src/marks/decorated_mark.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,12 @@ def setup_hat_styles_csv(hat_colors: dict[str, str], hat_shapes: dict[str, str])
153153
def init_hats(hat_colors: dict[str, str], hat_shapes: dict[str, str]):
154154
setup_hat_styles_csv(hat_colors, hat_shapes)
155155

156+
vscode_settings_path: Path | None = None
157+
156158
try:
157-
vscode_settings_path: Path = actions.user.vscode_settings_path().resolve()
159+
vscode_settings_path = actions.user.vscode_settings_path().resolve()
158160
except Exception as ex:
159161
print(ex)
160-
return lambda: None
161162

162163
def on_watch(path, flags):
163164
global fast_reload_job, slow_reload_job
@@ -170,10 +171,12 @@ def on_watch(path, flags):
170171
"10s", lambda: setup_hat_styles_csv(hat_colors, hat_shapes)
171172
)
172173

173-
fs.watch(str(vscode_settings_path), on_watch)
174+
if vscode_settings_path is not None:
175+
fs.watch(vscode_settings_path, on_watch)
174176

175177
def unsubscribe():
176-
fs.unwatch(str(vscode_settings_path), on_watch)
178+
if vscode_settings_path is not None:
179+
fs.unwatch(vscode_settings_path, on_watch)
177180
if unsubscribe_hat_styles is not None:
178181
unsubscribe_hat_styles()
179182

0 commit comments

Comments
 (0)