dya2 / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

Add syntax highlighting to editor #211

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Syntax highlighting for languages would make the editor more useful.

Original issue reported on code.google.com by damonkoh...@gmail.com on 4 Mar 2010 at 3:25

GoogleCodeExporter commented 9 years ago
If you are going to do this then can you also do the auto indent and 
potentially 
make switch offable the word wrap in portrait mode.

Original comment by Panquisitive on 9 Mar 2010 at 6:18

GoogleCodeExporter commented 9 years ago
Does this include syntax checking as well

Original comment by Panquisitive on 16 Mar 2010 at 5:57

GoogleCodeExporter commented 9 years ago

Original comment by damonkoh...@gmail.com on 22 Mar 2010 at 4:23

GoogleCodeExporter commented 9 years ago
Why not use "TouchQode"
You can find it in the Google Market

Original comment by tony537...@gmail.com on 9 Jul 2011 at 6:56

GoogleCodeExporter commented 9 years ago
Interface is far from perfect but the program is really interesting,
i'll give it a try some days :-)

Original comment by piranna on 10 Jul 2011 at 2:33

GoogleCodeExporter commented 9 years ago
A straightforward/naive implementation using spannable seems to become unusable 
after around 350 coloured tokens, with almost all of the time spent in setSpan 
and removeSpan. In addition, scrolling performance becomes very bad. Parsing 
time is negligible (with regexes).
Is it better to override the drawing code to improve the performance (since the 
highlighting doesn't need to be stored) or to keep track of code insertions and 
deletions to avoid removing and setting all the spans?

Original comment by ying...@gmail.com on 20 Jan 2012 at 5:09

GoogleCodeExporter commented 9 years ago
I think in a first step is better to check only the insertions and
deletions.

Sended from my Android cell phone, please sorry the lack of format on the
text and my fat thumbs :-P
El 20/01/2012 06:10, <android-scripting@googlecode.com> escribi�:

Original comment by piranna on 20 Jan 2012 at 6:42

GoogleCodeExporter commented 9 years ago
Well the parsing is fast, it's just the span logic that seems slow. I've 
already tried the obvious steps like (?:)+. It's possible to use touchqode's 
approach of only highlighting (longer) words (limiting the bumber of spans) 
although I don't even know if it uses spans.

Original comment by ying...@gmail.com on 20 Jan 2012 at 11:02

GoogleCodeExporter commented 9 years ago
Maybe it's overkilling... but if performance is such a problem, since it's
only highlighting and not changing font or size, why don't get marks of
current visible text and only render that?

Sended from my Android cell phone, please sorry the lack of format on the
text and my fat thumbs :-P
El 21/01/2012 00:03, <android-scripting@googlecode.com> escribi�:

Original comment by piranna on 20 Jan 2012 at 11:26

GoogleCodeExporter commented 9 years ago
I tried just a naive implementation. However, one token-filled screen could be 
slow. I'm not sure about this, but I think complete updates while scrolling 
might feel even worse. However, incremental ones would probably be fine. I'm 
not exactly sure how to do this, though. I think a fenwick tree and tracking 
text changes is the way to go.

Original comment by ying...@gmail.com on 20 Jan 2012 at 11:38