Skip to content

Commit

Permalink
Merge pull request #1940 from SublimeLinter/redo-1937
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed May 2, 2024
2 parents 754f55e + 70aef92 commit bafd21d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lint/util.py
Expand Up @@ -40,14 +40,21 @@
try:
UI_THREAD_NAME # type: ignore[used-before-def]
except NameError:
UI_THREAD_NAME: str = threading.current_thread().name
UI_THREAD_NAME = None # type: Optional[str]


@events.on('settings_changed')
def on_settings_changed(settings, **kwargs):
get_augmented_path.cache_clear()


def determine_thread_names():
def callback():
global UI_THREAD_NAME
UI_THREAD_NAME = threading.current_thread().name
sublime.set_timeout(callback)


def ensure_on_ui_thread(fn):
# type: (Callable[P, T]) -> Callable[P, None]
"""Decorate a `fn` to always run on the UI thread
Expand Down
1 change: 1 addition & 0 deletions sublime_linter.py
Expand Up @@ -72,6 +72,7 @@ def plugin_loaded():
persist.kill_switch = False
events.broadcast('plugin_loaded')
persist.settings.load()
util.determine_thread_names()
logger.info("debug mode: on")
logger.info("version: " + util.get_sl_version())

Expand Down

0 comments on commit bafd21d

Please sign in to comment.