Omnimaga
General Discussion => Technology and Development => Computer Projects and Ideas => Topic started by: Deep Toaster on May 25, 2012, 05:56:22 pm
-
Yeah, I know we have a lot of computer-based TI-BASIC editors already, but in my defense, I had an assignment to make something in C# and I decided to make an editor with a themable, extensible, and more efficient syntax highlighting.
It currently doesn't do any converting to or from 8XPs yet (so the Open and Save buttons don't actually work), but it does have a complete highlighting engine that I can easily add more themes (color schemes) and modes (language syntaxes) to. The TI-BASIC rulesheet is also automatically updated when the editor starts up (it's that UTR thing I'd been working on), so it always keeps up-to-date in case there are new additions or bugfixes.
-
Cool
If the conversion systems work, could you pm me the code? It would be handy if i could convert 8xp files to text files on my ipod, i know there would still be some things to adjust but it could be nice
-
Nice! You could make that it detects if it is a Axe program/Grammer program and change the highlighter. :)
-
Yeah that would be nice, then you don't need 3 different convertors
-
Maybe a option to turn auto-detect on. When tokenizing be also sure that Axe and grammer have token hooks :)
-
Holy sheet, looks amazing dude.
I always hated how none of the IDEs had syntax highlighting
-
Thanks :D
And what I'm personally proud of is that it only updates the text that actually got changed, so the editor won't slow down at all no matter how long your program is.
-
That's good. But loading times could take a while >:D
BTW, could you make then files that are to large to fit into the RAM of that calc? xD
-
That's good. But loading times could take a while >:D
About two seconds for a 20 KB program, which is about as large as possible in practical terms. (That's nothing compared to, say, gedit :P)BTW, could you make then files that are to large to fit into the RAM of that calc? xD
Of course—you can do that with any editor. Theoretically the largest program that can fit in an 8XP file is 65,518 bytes long
-
O.o two seconds! That's pretty fast! Cool!
Be sure that it'll be linux compatible :P
-
Oh wait, I got two seconds after disabling the highlighter :P
It's actually more like five minutes ... so yeah, it is slow. Whoops.
-
D: You need optimization :P
And don't, please don't forget to make it linux compatible :D
-
@ Deep Thought: do you have the nescessary skills to make this (not nescecerally (spelled weong) with the highlighter but it can be if you want) for ipod touch? (has to be cydia) i'll pay the costs, and should it then be possible to have a compiler and decompiler for the .8xp files?
-
Oh wait, I got two seconds after disabling the highlighter :P
It's actually more like five minutes ... so yeah, it is slow. Whoops.
You can always only highlight the visible lines, then make the editor usable while the rest of the lines are highlighted in a separate process. When the user scrolls, then continue to highlight from the new position, if that hasn't been highlighted yet.
-
Or maybe it first highlits the visible lines and then continues highlight in some other routine where you can also edit while it does all the other lines.
-
well, if i might recommend something (i know you probably did dpend a lot of time to the syntax highlighting) but here's a textbox that does all you want, and it does it fast:
http://www.codeproject.com/Articles/161871/Fast-Colored-TextBox-for-syntax-highlighting
although it is for visual basic and visual c#, so i don't know if you're using that..
-
Yeah, I'm thinking of putting the highlighting in a separate thread, so the user can keep typing while the editor slowly finishes highlighting the rest of the lines.
-
couldn't you just hilight only the lines that are to be displayed, and then do it as you go?
would that take too long on tall screens?
-
couldn't you just hilight only the lines that are to be displayed, and then do it as you go?
would that take too long on tall screens?
Then it would have to update the highlighting at every incremental change of the scroll position, and wouldn't update when the text changes (until it gets scrolled).
The editor is fine at updating while you type—I don't notice any lag at all when I'm typing a TI-BASIC program. The lag starts to get noticeable only when you open or paste a program that's somewhat long (more than a few dozen lines). The most reasonable solution is to put the highlighter in a separate thread so it can do its work without interfering in the user's typing, but that would involve restructuring the whole thing and will take a while for me to do.
Update
New:- Saving files - pressing Ctrl+S or clicking Save will tokenize the program to an 8XP
- Help - the help icon actually does something now, though it's not terribly useful yet
The name of the program generated goes in the text box between Open and Save, and you can toggle the checkbox at the bottom-right corner to set whether the program should be edit-locked or not (on the calculator).
The download is still in the first post.