问题
I'm writing a sublime text plugin. I'm trying open few files in new window.
In sublime text API reference I found a way to open files with
window.open_file(filepath)
but I didn't find anything for opening a new window. Can someone please point me to it. I know it's a dumb question but blame it on inadequate documentation :)
回答1:
You can use new_window
command.
sublime.run_command("new_window")
sublime.active_window().open_file(filepath)
By the way, you can find lots of useful information via checking the default packages/settings. For example, you can open default key bindings and search "window". You can find new_window
command. Sublime Text 2 has lots of features which are not documented.
来源:https://stackoverflow.com/questions/19826604/sublime-text-open-new-window-api