Control over script editor color syntax.

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm
Location: Blenheim, New Zealand

Control over script editor color syntax.

Post by paul_gr » Sun Nov 09, 2014 10:58 pm

This has been bugging me for years...

Any coding I do in other IDE's, I use commonly used dark themes, eg Cobalt/Monokai, primarily because of headache inducing eye strain if the background is too light.
I can keep familiar color syntax across IDE's and languages -- for example, my script editor background is usually set to dark slate blue, selected line set to teal, variables are light blue, comments are light gray, strings are green, etc in any environment I use, except in LC.

I am sure that Runrev could get LC to pull in a custom color theme through an external XML file. It shouldn't be that difficult to override the default theme.

Back in 2010 I used a plugin from Shaosean called scriptColourEditor v1.3.0. Worked quite well when I was using Rev 3.5...
I have used GLX2 but the editor colors are not customizable.

My 2c.

Paul
Last edited by paul_gr on Wed Nov 12, 2014 7:59 pm, edited 4 times in total.

newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: Control over code editor color syntax.

Post by newtronsols » Sun Nov 09, 2014 11:19 pm

What about preferences, appearance?
Attachments
appear.png

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm
Location: Blenheim, New Zealand

Re: Control over code editor color syntax.

Post by paul_gr » Sun Nov 09, 2014 11:47 pm

newtronsols wrote:What about preferences, appearance?
That does not do anything to change script colorization.
preferences, script editor, colorization could use more options than default, Revolution classic, and No Colorization.

Paul
Last edited by paul_gr on Wed Nov 12, 2014 7:59 pm, edited 1 time in total.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1761
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Control over script editor color syntax.

Post by [-hh] » Mon Nov 10, 2014 1:44 am

Isn't this a global OS problem?
I have sometimes similar 'bad effects' with my eyes.

On Mac then I use Accessibility > Displays > InvertColors. There is certainly similar for Win or Linux.
Sometimes only switching to grayScale or reducing transparency is good enough for me.
shiftLock happens

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 631
Joined: Fri Jun 27, 2008 9:00 pm

Re: Control over script editor color syntax.

Post by Mikey » Mon Nov 10, 2014 3:47 pm

The good news is that the script editor's source is aways available for your tweaking, and it's all written in LC (actually, most of the IDE can be hacked at your leisure). The bad news is that all of us talk a good fight, but none of us have really put in the time and effort to fix things like font, syntax coloring, etc. I have a big list of script editor things I want done, and when I'm frustrated I actually look at, but I still haven't done, yet.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1761
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Control over script editor color syntax.

Post by [-hh] » Mon Nov 10, 2014 4:13 pm

How could we do that? Where is a chance to do that?
shiftLock happens

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 631
Joined: Fri Jun 27, 2008 9:00 pm

Re: Control over script editor color syntax.

Post by Mikey » Mon Nov 10, 2014 4:31 pm

You mean, how do you modify the script editor? It's just a stack in the LC bundle. There are a couple of ways to do it. One is to have LC not hide all the interface elements, then poke your way through. The other is (on a mac) to right-click on the version of LC you're using, select "Show Package Contents", then navigate through Contents->Tools->Toolset, and in there you will find "revscripteditor.rev". Make a copy of it on your desktop and rename it. You'll also have to rename the stack from within LC, and then you will start running into all the things that you break by doing it. If you stick with it, you will probably get code folding added before I get to it.

You can also suspend the development tools. I forget where that is, but there are times when you have to if you want to hack the IDE.

Right now it isn't easy to work on the IDE, but you can do it. I got a change to the datagrid accepted, so now when you resize a dg header on mobile, you can thank me for the dividers resizing as well.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1761
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Control over script editor color syntax.

Post by [-hh] » Mon Nov 10, 2014 4:45 pm

I meant a place like the already existing subforum "IDE contributors" that's sadly not (yet) functional.

There you could bring in your collected suggestions and ideas as "IDE-feature" request, or even in part of a piece of code, that some maintainers could build into selected parts of the IDE, if applicable. You could, if it would work.

I'm convinced that (parts of) GLX and other editor modules are immediately available from experienced users (like you) as soon as it starts, if it starts.
shiftLock happens

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 631
Joined: Fri Jun 27, 2008 9:00 pm

Re: Control over script editor color syntax.

Post by Mikey » Mon Nov 10, 2014 5:19 pm

Unfortunately, for me, messing with the IDE happens most right after I'm screaming at it for some flaw or another. However, I can't wait to get my hands on 8.0, when I can start going back to the compileIt! days of using LC syntax to hook into native routines. THAT, I think, will be another big step toward having lots of us wreaking havoc and making this bugger even awesomer.

Native controls might be nice, too.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4614
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Control over script editor color syntax.

Post by jacque » Tue Nov 11, 2014 7:30 pm

Syntax coloring used to be done in scripts but is now done internally by the engine in order to speed up the script editor. There needs to be an engine change so it can recognize custom themes, so you'd need a feature request for that.

The only other thing you could do would be to script the colorization yourself and overwrite the default colors after the script opens. That would probably be slower than RR's original though.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 631
Joined: Fri Jun 27, 2008 9:00 pm

Re: Control over script editor color syntax.

Post by Mikey » Tue Nov 11, 2014 7:44 pm

Yeah, but in 8.0...

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm
Location: Blenheim, New Zealand

Re: Control over script editor color syntax.

Post by paul_gr » Wed Nov 12, 2014 3:51 am

snagged.png
Since I'm the OP I thought I'd stop complaining and edit the script editor stack myself.

Here's the results so far.

Paul
Last edited by paul_gr on Tue Dec 09, 2014 7:38 pm, edited 3 times in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6151
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Control over script editor color syntax.

Post by FourthWorld » Wed Nov 12, 2014 5:08 am

paul_gr wrote:
snagged.png
Since I'm the original OP I thought I'd stop complaining and edit the script editor stack myself.

Here's the results so far.
Nice work, Paul. Where did you finf those values?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm
Location: Blenheim, New Zealand

Re: Control over script editor color syntax.

Post by paul_gr » Wed Nov 12, 2014 6:15 am

Hi Richard,

settings are in the stack script of "revScriptEditor".
LC preferences >> general, make sure the checkbox "Livecode UI elements appear in list of stacks" is checked
To see this stack you need to have the script editor open before you open the project browser.
Open the script of stack "revScriptEditor".
scroll down to
command seColorizationLoadScheme pScheme, @pPreferencesArray
In LC 6.7 it's around line 679
the switch statement contains all script color options, "default", "revolution classic", and "no colorization"

here is the set containing the changes I have made to the case "default" part of the function.
----------------------------------------------------------------------------------------------------------------------------------
command seColorizationLoadScheme pScheme, @pPreferencesArray
switch pScheme
case "default"
put "group commands bold 255,255,0" & return & \
"group properties none 0,255,255" & return & \
"group functions none 255,0,255" & return & \
"class error none 255,0,0" & return & \
"class singlecomment bold 0,127,255" & return & \
"class multicomment italic 0,127,255" & return & \
"class identifier none 127,127,127" & return & \
"class literal none 127,255,0" & return & \
"class number none 127,255,0" & return & \
"class keyword none 255,122,23" & return & \
"class operator bold 127,127,127" & return & \
"class continuation none 127,127,127" & return & \
"keyword command bold 127,127,127" & return & \
"keyword private bold 127,127,127" & return & \
"keyword on bold 255,255,255" & return & \
"keyword end bold 255,255,255" & return & \
"keyword if bold 255,255,255" & return & \
"keyword then bold 255,255,255" & return & \
"keyword else bold 255,255,255" & return & \
"keyword function bold 255,255,255" & return & \
"keyword setprop bold 127,127,127" & return & \
"keyword getprop bold 127,127,127" & return & \
"keyword repeat bold 127,127,127" & return & \
"keyword switch bold 127,127,127" & return & \
"keyword try bold 127,127,127" & return & \
"keyword catch bold 127,127,127" & return & \
"keyword case bold 127,127,127" & return & \
"keyword default bold 127,127,127" & return & \
"keyword finally bold 127,127,127" & return & \
"keyword next bold 127,127,127" & return & \
"keyword exit bold 127,127,127" & return into pPreferencesArray["colorization,config"]
break
--------------------------------------------------------------------------------------------------------------------------------------------
Background color is changed to RGB 0,30,60.

after making changes, right click on stack stack "revScriptEditor" from inside the project browser and hit save.
Restart LC to see changes.

Paul

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4614
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Control over script editor color syntax.

Post by jacque » Wed Nov 12, 2014 5:08 pm

Nice work! I'd assumed the color settings were in the engine. Glad you found them.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Feature Requests”