My plug in uses on_load to look for certain file types. When found, the code processes the file contents and ends up with a JSON-formatted string. The plan was to open a new file and add the JSON to this window. e.g:
class FileConverter(sublime_plugin.EventListener):
def on_load(self, view):
json_results = ProcessFile()
#put results in new file/tab
new_file = view.window().new_file()
new_file.insert(edit, 0, json_results) <- this does not work as I do not have an instance of edit, nor can I create one in ST3
According to the latest(?) documentation, Edit objects can oly be obtained through a TextCommand; they cannot be created in code. So how can I add text to a new file/tab without going through a TextCommand. Or if I create a TextCommand, how would I associate its edit instance with my new file/tab?