From d18797bc932c709c16e0f329af6a6d50a5047f12 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Tue, 5 Oct 2021 22:13:46 +0100 Subject: [PATCH] Only watch settings file itself --- src/marks/mark.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/marks/mark.py b/src/marks/mark.py index ef8a69ab..30e8f933 100644 --- a/src/marks/mark.py +++ b/src/marks/mark.py @@ -175,17 +175,16 @@ def on_ready(): setup_hat_styles_csv() - vscode_settings_path: Path = actions.user.vscode_settings_path() + vscode_settings_path: Path = actions.user.vscode_settings_path().resolve() def on_watch(path, flags): global fast_reload_job, slow_reload_job - if vscode_settings_path.match(path): - cron.cancel(fast_reload_job) - cron.cancel(slow_reload_job) - fast_reload_job = cron.after("500ms", setup_hat_styles_csv) - slow_reload_job = cron.after("10s", setup_hat_styles_csv) + cron.cancel(fast_reload_job) + cron.cancel(slow_reload_job) + fast_reload_job = cron.after("500ms", setup_hat_styles_csv) + slow_reload_job = cron.after("10s", setup_hat_styles_csv) - fs.watch(vscode_settings_path.parents[0], on_watch) + fs.watch(vscode_settings_path, on_watch) app.register("ready", on_ready)