dark mode, syntax coloring, and code folding

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

Moderator: Klaus

Post Reply
cookiejar
Posts: 4
Joined: Sat Nov 27, 2021 6:48 pm

dark mode, syntax coloring, and code folding

Post by cookiejar » Tue Nov 30, 2021 6:21 pm

So happy to join the LiveCode family and (hopefully) say farewell to JavaScript. That said, I have a few suggestions while LC10 is in development.

In the script editor I also would like dark mode, syntax coloring, and code folding.

It would also be nice to change the size of palettes, which are tiny and hard to read on a large monitor.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: dark mode, syntax coloring, and code folding

Post by FourthWorld » Tue Nov 30, 2021 6:48 pm

cookiejar wrote:
Tue Nov 30, 2021 6:21 pm
So happy to join the LiveCode family and (hopefully) say farewell to JavaScript.
Welcome aboard.

As we explore the strengths and weaknesses of different systems, I find it helpful for me to hear how people arrive here.

What did you find off-putting with JavaScript?

Do you have previous experience with HyperCard or similar scripting?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 3060
Joined: Sun Jun 04, 2006 9:39 pm

Re: dark mode, syntax coloring, and code folding

Post by stam » Tue Nov 30, 2021 8:42 pm

cookiejar wrote:
Tue Nov 30, 2021 6:21 pm
code folding
+1

Theming (syntax colouring, dark mode etc) would be an optional nice feature, but code folding would be extremely useful, if not essential for long scripts...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: dark mode, syntax coloring, and code folding

Post by dunbarx » Tue Nov 30, 2021 9:24 pm

Hi.

Do you mean things like the "tools" palette? The reason I ask is twoFold:

1- Everything in LC is a stack, and one can hack into that fact at one's pleasure. Oh, and peril.

2- That said, if you try to, say, set the loc of stack "revTools", no problem. But if you try to set the rect of that stack, you will not get an error, but you also will not change that rect. You can certainly hack into the IDE and find where that gets buried. Watch out for the peril.

Craig

cookiejar
Posts: 4
Joined: Sat Nov 27, 2021 6:48 pm

Re: dark mode, syntax coloring, and code folding

Post by cookiejar » Tue Nov 30, 2021 11:08 pm

FourthWorld wrote:
Tue Nov 30, 2021 6:48 pm
Welcome aboard.

As we explore the strengths and weaknesses of different systems, I find it helpful for me to hear how people arrive here.

What did you find off-putting with JavaScript?

Do you have previous experience with HyperCard or similar scripting?
Thanks for the welcome, Richard. Like many others, I was bitten by the HyperCard bug way back. I used it in an elemtary classroom. One Mac and 30 kids, yet the cooperation and shared imagination among them was astonishing. The only other software to come close was ChipWits and U. of Berkley’s Snap!

I drifted into Macromedia Director, then mFactory mTropolis (pause a moment for the beloved mTroplis and obligatory curse on Quark for quashing it). Eventually I started making web pages. HTML and CSS are intuitive to me, but JavaScript is not. I have an app, for instance, for interactive fiction, that uses a small hypertext engine written in JavaScript. I can create interactive quizzes or stories with HTML/CSS, but am largely clueless as to how the JavaScript works or how I might expand it without pestering the author (who to date has been generous, but urges me to learn how to code). JavaScript does not work like I think; LiveScript does. It’s like programming in pseudocode, with a lot of the fiddly-bits taken care of (esp. semicolons).

LiveCode was always on the horizon, but I need web apps and web pages, not stand-alones. Then came the announcement of LC10 with its faster web engine (goodbye 26 Mb start-up). Now it feels whole circle; here I am chatting with one of the gurus of X Talk languages and noticing many others (Jeanne DeVoto still around?).

I think the future of the web is WebAssembly and, who knows, may one day offer online courses leveraging the approachability of LiveCode with the power of WASM. To that end, I am trying to absorb as much as I can before posting noob questions. There are many LC examples, but some go back a decade or more, same with documentation, so I have just been trying things and seeing whether they break. BTW, I would be happy to share the interactive fiction template and invite help converting it to LC10.

cookiejar
Posts: 4
Joined: Sat Nov 27, 2021 6:48 pm

Re: dark mode, syntax coloring, and code folding

Post by cookiejar » Tue Nov 30, 2021 11:33 pm

dunbarx wrote:
Tue Nov 30, 2021 9:24 pm

1- Everything in LC is a stack, and one can hack into that fact at one's pleasure. Oh, and peril.
Great stuff, Craig. LC10 > Contents > Tools > etc to the Tools Pallet opens the Tools pallet, as if I pressed Command T, not a stack that I can edit. What am I missing or doing wrong?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: dark mode, syntax coloring, and code folding

Post by dunbarx » Wed Dec 01, 2021 1:47 am

What am I missing or doing wrong?
Nothing. LC is rather protective of its own. But it is just a stack, and lives in the IDE. Try this:

Code: Select all

edit the script of stack "revTools"
In the openStack handler add this:

Code: Select all

answer random(9999)
Yep, whenever you open the tools palette, you will be annoyed by that dialog and a pointless integer. Do remember to lose it.

Does this mean you have hacked into a building block of the IDE? Yes. Does this mean you can change the rect of the stack? No. I rarely get into this, but I would have bet there is a setProp handler in there that diverts such shenanigans away from unwary users. I don't, in fact see such a handler anywhere, but that means nothing. Others might chime in on why one cannot get past that level of control over that stack.

Anyway, If you want bigger tools palette, write your own. In fact, this is an excellent project for you. Do you know how to create a new button, say, just as if you dragged one from the regular tools palette? Can you simulate dragging one from your new gadget?

Make it colorful while you are at it.

Craig

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: dark mode, syntax coloring, and code folding

Post by mwieder » Tue Dec 28, 2021 3:43 am

cookiejar-

If you don't mind a script editor that doesn't come in the original box, the glx2 script editor has code folding, dark mode (chalkboard) and to a certain extent syntax coloring.

https://github.com/mwieder/glx2ScriptEditor

That said, if you check "Show IDE Stacks in Lists" in the "View" menu you will see all the IDE stacks in the Project Browser. From there you can edit the scripts and possibly save the changes, depending on what your operating system will allow. Lots of hacking possibilities, and easy ways to get yourself into Good Trouble. Make backup copies.

Post Reply