I posted this at StackOverflow when the forum was down. Hopefully I can get some more information here.
In Sublime Text 3 I have a few packages that open new files within the window. They have functions that look like:
class BufferCommand(sublime_plugin.WindowCommand):
def run(self):
view = self.window.new_file()
...
I grabbed this for something I am working on, and couldn’t get a new file to generate, even though that works for the plugin I snagged it from, and is similar to how it is used in Packages/Default/new_templates.py. After some more searching, I found the following code, and it works as expected
class TestCommand(sublime_plugin.TextCommand):
def run(self,edit):
view = self.view.window().new_file()
Can somebody tell me why?