From 66203b58dc089b245496d2dfa6ab1e5dbc0e3df6 Mon Sep 17 00:00:00 2001 From: jwortmann Date: Thu, 14 Nov 2024 09:02:23 +0100 Subject: [PATCH] Fix possible exception on settings change (#2555) --- plugin/core/windows.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugin/core/windows.py b/plugin/core/windows.py index 8480674d3..9234724ef 100644 --- a/plugin/core/windows.py +++ b/plugin/core/windows.py @@ -563,12 +563,6 @@ def discard(self, window: sublime.Window) -> None: if wm: sublime.set_timeout_async(wm.destroy) - def _on_userprefs_updated_async(self) -> None: - for wm in self._windows.values(): - wm.on_diagnostics_updated() - for session in wm.get_sessions(): - session.on_userprefs_changed_async() - # --- Implements LspSettingsChangeListener ------------------------------------------------------------------------- def on_client_config_updated(self, config_name: str | None = None) -> None: @@ -576,7 +570,10 @@ def on_client_config_updated(self, config_name: str | None = None) -> None: wm.get_config_manager().update(config_name) def on_userprefs_updated(self) -> None: - sublime.set_timeout_async(self._on_userprefs_updated_async) + for wm in self._windows.values(): + wm.on_diagnostics_updated() + for session in wm.get_sessions(): + sublime.set_timeout_async(session.on_userprefs_changed_async) class RequestTimeTracker: