sublime
sublime

Reputation: 4161

Sublime Text Open New Window API

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 :)

Upvotes: 1

Views: 1368

Answers (1)

longhua
longhua

Reputation: 4242

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.

Upvotes: 10

Related Questions