From 7526198e0662ec768a1f0ebefe4770331e03c560 Mon Sep 17 00:00:00 2001 From: Justin Israel Date: Tue, 4 Jul 2017 10:00:23 +1200 Subject: [PATCH] Prevent recursive syncing of settings at first load of plugin --- MayaSublime.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/MayaSublime.py b/MayaSublime.py index b54a771..bda9839 100644 --- a/MayaSublime.py +++ b/MayaSublime.py @@ -233,7 +233,21 @@ def settings_obj(): return sublime.load_settings("MayaSublime.sublime-settings") +_IS_SYNCING = False + def sync_settings(): + global _IS_SYNCING + if _IS_SYNCING: + return + + _IS_SYNCING = True + try: + _sync_settings() + finally: + _IS_SYNCING = False + + +def _sync_settings(): so = settings_obj() _settings['host'] = so.get('maya_hostname')