Skip to content

Commit

Permalink
Fix possible exception on settings change (#2555)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann authored Nov 14, 2024
1 parent 2f37a49 commit 66203b5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions plugin/core/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,20 +563,17 @@ 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:
for wm in self._windows.values():
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:
Expand Down

0 comments on commit 66203b5

Please sign in to comment.