I am trying to create a Sublime Text 3 plugin that writes output to an output panel in the current window. I found some examples using this with begin_edit and end_edit, which are no longer supported in ST3. As far as I understand, ST3 requires me to define TextCommand to support the editing action on my output panel. So far I have this:
class SfprintCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, self.view.size(), 'hello')
class SfCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.panel = self.view.window().create_output_panel('sf_st3_output')
self.view.window().run_command('show_panel', { 'panel': 'output.sf_st3_output' })
self.panel.run_command('sfprint');
I expect this to print the text βhelloβ on my output panel, but when I try to call it through the console (by launching view.run_command('sf')), it displays a new panel, but does not print any information into It. How to write text to this panel?