If you remember, Beta had a fairly advanced code editor. It wasn’t perfect, but its absence is definitely felt. In general, editing complex IOBoxes is not an easy task these days. Now I am trying to write a CustomFunction and I cannot call the process easy. And it’s not even that sdsl doesn’t have clear documentation, but simply that I can’t write more than a few lines of code locally, so it doesn’t become a tedious task - I have to struggle with editors, copy something to Sublime, edit it there, then copy it back.
And then I had an interesting thought. What if we could write a simple extension to Sublime that would allow us to open VL files and edit IOBoxes? After all, it’s basically XML, and if you pass the right ‘PAD ID’ you can edit that location and save it in the same section of the file. I realise this is just a hypothetical thought, I haven’t looked into this in any depth yet. But if you find this idea interesting, can you suggest or think about what the problems might be?
The main disadvantage of this approach so far is that the patch itself does not update the contents of the Pad in real time when files are changed. So changing a file does not change the patch. Which is sad, of course.
How about adding a right-click action to IO Box named “Open in external editor”?
Like Git opens an external editor when you do git commit without -m or when you do interactive rebase. Or if you have used linux sudoedit does it too.
A (temp) file will same content is created and passed to editor. If the editor saves it and closes it, VVVV updates the string. Otherwise, if left unchanged and closed, VVVV leaves the string as-is.
We’d need Editor Path and Editor Wait Args. Wait args are supported by popular editors like VS Code and Sublime Merge.
Benefits of this approach:
Editor independent: No need to create plugin for each editor to support editing of IO Box
User can edit content on their favorite editor
Downsides of this approach:
No dynamic updates: After saving the content and closing the file, if you want to re-edit it, you’d have to click on “Open in external editor” context menu action again.
Have you studied how the Patch works? Create a patch with Pad, insert a complex string and see how it looks.
Without pre- and post-processing, it is impossible to edit what is in an XML field. So if you look at my efforts above, you will see that a plugin is required to edit the patch file directly.
If your approach involves editing via intermediate files, this is certainly an interesting approach, but requires much more effort to implement.
Oh my suggestion was towards vvvv devs. I haven’t read the code that you supplied in zip but I understand the gist. I was only proposing an alternative solution.
On your idea: I suppose auto document reload feature discards any change that I’ve made in my patch so I suppose I’d always have to ensure I have saved my patch before I invoke your Sublime Text command.
The idea I suggested ain’t perfect either. Either way, we both agree that a tighter integration with third-party editors is warranted.