klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

external editor hook (automatic) #207

Open klembot opened 8 years ago

klembot commented 8 years ago

Originally reported by: tryguy (Bitbucket: tryguy, GitHub: tryguy)


So, I have an idea that might suit some people.

What if (in the options) you could define a preferred editor to bring up an external editor instead of the normal (very basic) editor?

Rather than spend a lot of time enhancing the internal editor, it might work out better if the work is just offloaded to one of the excellent programming editors available.

I think getting the (opened) passage text into an external editor should be relatively simple. But, I'm not sure how any edited text could be re-imported. Unless, there was some kind of link set up between the internal passage editor and the external editor, and when "saving", it just sent the text back, replacing all of the internal editor's contents.

Then, the user might close the passage again (having confirmed the edit was good), and it would be available to the story to use.

How feasible would this be in reality?

The reason I mention this is... I'm not sure what kind of time there might be before the internal editor is feature complete. It might be a lot easier to just hand the heavy lifting to external editors, or at least have that as a user choice.


klembot commented 8 years ago

Original comment by Georges Giroux (Bitbucket: cyberbum, GitHub: cyberbum):


I would also find this pretty awesome to have the choice of editors. It would also free up the developers from adding more features, they could just have an editor hook.

nebreywas commented 2 years ago

So I just spent a few minutes looking to see if someone had suggested this and I'm glad who did! I was just about to ask for this as a feature as well as simple search (don't need replace just quick find for fast fixes) in the editor itself.

My twines use a lot of Javascript and are fairly complicated pieces of code and I've had to resort to using Panic's excellent NOVA editor which I love but because there's no real link between the two it's a lot of cutting and pasting with definite hazards involved with that.

I was even going to suggest to Cabel at Panic to improve their code support for Twine given the << >> tag format, etc.

Doing this one thing would increase my productivity significantly.

klembot commented 2 years ago

Thanks for adding your feedback! An issue here is that Twine tries to stay as similar between web and desktop usage and I don't see how this could work in a web context.

You might find it easier to use tweego or another CLI tool inside of your editor, though there are of course tradeoffs.