Fire delayed event to show 'restart message'
Without the delay, even if the command was already registered and
getting executed, the panel just didn't show up.
@@ -54,9 +54,7 @@ def plugin_loaded():
persist.kill_switch = True
persist.linter_classes.clear()
- util.show_message(
- 'SublimeLinter has been installed or upgraded. '
- 'Please restart Sublime Text.')
+ sublime.set_timeout_async(show_restart_message, 100)
return
except ImportError:
pass
@@ -95,6 +93,16 @@ class SublimeLinterReloadCommand(sublime_plugin.WindowCommand):
reloader.reload_everything()
+def show_restart_message():
+ window = sublime.active_window()
+ window.run_command("sublime_linter_display_panel", {
+ 'msg': (
+ 'SublimeLinter has been installed or upgraded. '
+ 'Please restart Sublime Text.'
+ )
+ })
+
+
def visible_views():
"""Yield all visible views of the active window."""
window = sublime.active_window()
