sublime text 3
我用 3 个命令创建了插件:其中 2 个是 type TextCommand
,其中一个是WindowCommand
import sublime, sublime_plugin
class simple_text_pluginCommand(sublime_plugin.TextCommand):
def run(self, edit):
print("Hello World simple_text_plugin")
class simple_text_plugin2Command(sublime_plugin.TextCommand):
def run(self, edit):
print("Hello World simple_text_plugin2")
class simple_window_pluginCommand(sublime_plugin.WindowCommand):
def run(self):
print("Hello World simple_window_plugin")
为什么我只能从sublime command line
(ctrl + `) 调用文本命令:
>>> view.run_command('simple_text_plugin')
Hello World simple_text_plugin
>>> view.run_command('simple_text_plugin2')
Hello World simple_text_plugin2
但不能调用window
命令:
>>> view.run_command('simple_window_plugin')
没有输出。如何从运行Window
类型插件sublime console
?