klembot / twinejs

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

Passage autocomplete should really be on the story format side #134

Open klembot opened 9 years ago

klembot commented 9 years ago

Originally reported by: Leon Arnott (Bitbucket: L, GitHub: Unknown)


The story formats have specific idiosyncratic markup structures that would benefit from autocomplete, so it would be better if all autocomplete prompts were implemented by the story format alongside its syntax highlighter.

There is a means (albeit reliant on an aforementioned necessary hack) for the story format CM code to access and modify the CodeMirror instance (see here) to add such options as prefixTrigger to it. (Although, this means that when switching formats, CM's options would have to be reset to defaults prior to the format's new options being applied.)


klembot commented 9 years ago

Original comment by Anton Zhuchkov (Bitbucket: fireton, GitHub: fireton):


YES! Link detection really needed be don on the story format side. Even now some links is not detected if you using the SugarCube story format. Also I was thinking about my own story format and I don't want be obliged to stick to [[]] link tag.

klembot commented 9 years ago

Original comment by Chris Klimas (Bitbucket: klembot, GitHub: klembot):


My take on this is similar to what I think we should do for link detection, i.e. provide some basic behavior and then allow story formats to override it. I am considering writing a very bare bones highlighter too... maybe. We really just need a spec for this and then let you guys go to town.