This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
supernicejohn's profile picture

LightText

Started by supernicejohn, 08 December 2016 - 03:04 PM
supernicejohn #1
Posted 08 December 2016 - 04:04 PM
From the developer of "Texty" (that's a bad merit… Look how much I've evolved!),

LightText


Yes, it's another Text editor! But this time… actually usable…

So, let's get right into the features!
featuresBasic editing! I mean that's the minimal requirement.
Open/Save Also basics…
CodeMode text highlighting, for coding.
Good navigation I hope you like the controls…
Yes! CodeMode! Just like the default edit program this has highlighting for different things.
Right now it is however lacking string highlighting. That will be added as soon as I figure out how to implement that ;)/>

Something different from default "edit" is that you can change the options, I'll make a complete settingsfile soon, right now it doesn't contain much so if you for example want to change the highlighting color for… "for" you do that by editing the program. Atleast you can :)/>

screeniesOfcourse! Here they are:
[attachment=2704:EXAMPLE1.PNG]
[attachment=2705:EXAMPLE2.PNG]

So, in the end I know everyone has their preffered text editor outside of CC, and when they have to edit something in-game, "edit" takes less time to type, but I see my program more as a learning experience. Well then, here you go!
Download: http://pastebin.com/PFa3LY1Y

Small Edit: some functions fixed, the flickering problem is almost completely gone, and the Syntax highlighting is fixed, colors are more uniform and fitting. :)/>
Edited on 14 December 2016 - 09:48 AM
Mao Zedong #2
Posted 08 December 2016 - 05:39 PM
It definitely looks better than your last project. I have a few criticisms, though.
for i=1,16384 do
text[i] = file.readLine()
if text[i] == nil then break end
end
This only loads the first 16384 lines of the file. While almost nobody will edit a file this large, it is a useless limitation. Consider changing it to:

for line in file.readLine do --# yes, this is valid lua.
table.insert(text, line)
end
The reason your `…` and `..` keywords don't work properly is because you recolour SYNTAX before you recolour KEYWORDS. Swap the `for k,v in pairs(SYNTAX) do` and `for k,v in pairs(KEYWORD) do` loops for it to work as you expect.

As well as this, the menu code text is difficult to read. Consider changing the text colour to white, and cleaning it up by making the lines consistent and easier to read.

Finally, your syntax highlighting is a bit to hippy tie-dye to be readable. All "syntax" should have the same colour, and same for all "keywords". Additionally, dark grey for table indexes are unreadable, pink for true/false is a non-harmonious colour, and magenta for table braces is out of place.
Edited on 08 December 2016 - 04:42 PM
supernicejohn #3
Posted 08 December 2016 - 06:02 PM
It definitely looks better than your last project. I have a few criticisms, though.
for i=1,16384 do text[i] = file.readLine() if text[i] == nil then break end end
This only loads the first 16384 lines of the file. While almost nobody will edit a file this large, it is a useless limitation. Consider changing it to:
 for line in file.readLine do --# yes, this is valid lua. table.insert(text, line) end 
The reason your `…` and `..` keywords don't work properly is because you recolour SYNTAX before you recolour KEYWORDS. Swap the `for k,v in pairs(SYNTAX) do` and `for k,v in pairs(KEYWORD) do` loops for it to work as you expect. As well as this, the menu code text is difficult to read. Consider changing the text colour to white, and cleaning it up by making the lines consistent and easier to read. Finally, your syntax highlighting is a bit to hippy tie-dye to be readable. All "syntax" should have the same colour, and same for all "keywords". Additionally, dark grey for table indexes are unreadable, pink for true/false is a non-harmonious colour, and magenta for table braces is out of place.
Thank you for the critisism!
the artificial limit is probably a bad habit, maybe I'll gather enough confidence in my program to let it edit infinite lines, but there are flicker issues to solve before that (quite a big problem actually).
I'll definitely try swapping the loops though, good catch ;)/>
For the colors… I actually picked some of them because I ran out of good colors to use, originally I also had different colors for while, for, repeat, but that looked, well, like you describe it :P/>
Again, thanks for the criticism!
Edited on 08 December 2016 - 05:03 PM
houseofkraft #4
Posted 14 February 2017 - 01:26 AM
I was moving the cursor around a bit and i got this
Edited on 14 February 2017 - 12:27 AM
supernicejohn #5
Posted 14 February 2017 - 07:19 AM
Well that's odd.
Didn't expect an error to actually come up, but it's most likely caused by some weird screen movement on the programs part. Did it work afterward or lock up?

And btw, thanks for using it! I might release one of my newer projects that certainly doesn't have that bug in it!
=)