Sublime Text Open New Window API

六眼飞鱼酱① 提交于 2019-12-25 05:16:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!