Sublime Text 打开新窗口 API [英] Sublime Text Open New Window API

查看:44
本文介绍了Sublime Text 打开新窗口 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 sublime 文本插件.我正在尝试在新窗口中打开几个文件.

I'm writing a sublime text plugin. I'm trying open few files in new window.

在 sublime text API 参考中,我找到了一种方法用

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

推荐答案

您可以使用 new_window 命令.

sublime.run_command("new_window")
sublime.active_window().open_file(filepath)

顺便说一下,您可以通过检查默认包/设置找到很多有用的信息.例如,您可以打开默认键绑定并搜索窗口".您可以找到 new_window 命令.Sublime Text 2 有许多未记录的功能.

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.

这篇关于Sublime Text 打开新窗口 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆