Skip to content

Commit

Permalink
Prevent recursive syncing of settings at first load of plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfx authored Jul 3, 2017
1 parent 568ebf5 commit 7526198
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions MayaSublime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 7526198

Please sign in to comment.