Sublime Forum

Execute plugin on startup

#1

I am writing a really simple plugin that simply opens the linter panel on the opening of Sublime Text 3, but it doesn’t seem working.
This is the plugin:

import sublime
import sublime_plugin

def plugin_loaded():
	window = sublime.active_window()
    if window is None:
    	return sublime.set_timeout(lambda: plugin_loaded(), 100)
	window.run_command("sublime_linter_panel_toggle")

What am I doing wrong?(The plugin is saved in “Sublime Text 3/Packages/User/linter.py”)

0 Likes

#2

Do any errors get logged in the console?

0 Likes

#3

It could be that SL is not loaded yet so the command is not available (but ST won’t emit error for nonexistent commands).

0 Likes

#4

Thanks guys, i finally solved my problem:
the console said that there was a problem with indentation so i replaced tabs with spaces and now it works fine.

0 Likes