I use the FLTK editor that is part of Xprogs.tcz for scripting and editing
various config files (bootlocal.sh, .filetool.lst, .xsession, .profile, etc).
The editor works quite well for these tasks, but there is one thing I don't
like about it. It does syntax highlighting for comments, keywords, data types,
strings, etc. That's fine if you're using it to write C or C++, but not for an
editor that's a part of the base GUI apps.
I decided to try to revert editor to just black text, like it was in TC3.8.4.
So first I copied editor.cxx and Makefile from the Tinycore fltk projects git.
I managed to remove the syntax highlighting code.
I also found a later version of the program that had line number and word wrap
options that could be turned on/off during run time. I added those as well but
I wrapped them in preprocessor directives to make them compile time options.
The Xprogs extension is unchanged since TC10. So I compiled 32 and 64 bit versions
against fltk-1.3-dev.tcz under TC10. I used TC10 because the compiler produces smaller
executables. These are the results:
File Sizes
| 32 Bit | 64 Bit |
Original size | 14204 | 19528 |
Highlighting removed | 9948 | 13736 |
Version added to menu | 10088 | 13936 | Note: under TC14, 64 bit version was 15696 bytes
Word wrapping enabled | 10380 | 14344 | Note: under TC14, 64 bit version was 16200 bytes
Line numbers enabled | 10572 | 14472 | Note: under TC14, 64 bit version was 16296 bytes
Both enabled | 10800 | 14752 | Note: under TC14, 64 bit version was 16640 bytes
Version information:
Line Numbers and Word Wrap menu entries and short cuts:
Line Numbers turned on:
Line Numbers and Word Wrap turned on. They work quite well together. Where the
line gets wrapped, the line number is blank because its still part of the
previous line:
I like the idea of being able to turn on line numbers for when I get errors like this:
./Speed.tst: line 77: syntax error: unexpected "(" (expecting ")")
so I can easily find line 77.
I've tested the binaries (32 and 64 bit) under TC10, 14 and 15. I expect them to
work under TC10-TC15, just like the current version of Xprogs.
So now I need some input from forum members and administrators as to what to do next.
That does not include adding features. I don't speak C++.
I could:
Create x86 and x86_64 extensions that place the new editor in their ~/.local.bin
directories so it's first in their PATH. The existing icon and menu entry will
then start the new version instead of the Xprogs version because they don't
specify a path. Optionally, I could also add them to the TC10-TC15 repositories.
If there's enough interest, I could repackage the Xprogs extension with the
new editor.
If any of the administrators want to incorporate this into TC16, I can push (pull?)
it into git.
Or any other suggestions I didn't think of.