我似乎无法插入通过“open_file”创建的视图:
import sublime, sublime_plugin, re, os.path
class ExtractToViewCommand(sublime_plugin.TextCommand):
  def run(self, edit):
    view = sublime.active_window().open_file("/path/to/some/file/that/doesnt/exist/yet")
    view.set_read_only(False)
    print(view.is_read_only())         # prints True!
    e = view.begin_edit()
    view.insert(e, 0, "hello world")   # returns 0!
    view.end_edit(e)
我的目标是创建一个插件来将选定的文本提取到一个新文件中。当我将其更改为使用new_file而不是open_file. 有什么我想念的想法吗?