Does Livecode have a prettify option?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

karmacomposer
Posts: 355
Joined: Wed Apr 27, 2011 2:12 pm

Does Livecode have a prettify option?

Post by karmacomposer » Thu Jul 23, 2020 10:50 pm

In other languages/IDE's there is a prettify feature. It pretty much takes the code and makes sure it indents properly.

I write a lot of Livecode code either in Sublime or even notepad/notepad++

However, the code, when pasted into Livecode's editor, does not indent automatically. I would have to press enter on each
and every line to make it look right.

Is there a one key/command to do this for all the code of a given script?

Thanks.

Mike

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7321
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Does Livecode have a prettify option?

Post by dunbarx » Thu Jul 23, 2020 11:18 pm

Hi.

Clicking the tabKey will indent the entirety of the SE. You have to select "autoFormat" in the SE preferences. You can also set the width of the indentation.

Craig
Last edited by dunbarx on Fri Jul 24, 2020 4:26 am, edited 2 times in total.

karmacomposer
Posts: 355
Joined: Wed Apr 27, 2011 2:12 pm

Re: Does Livecode have a prettify option?

Post by karmacomposer » Fri Jul 24, 2020 4:02 am

Ty. I will try that.

Mike

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

Re: Does Livecode have a prettify option?

Post by Mikey » Fri Jul 24, 2020 2:11 pm

Is there any reason you are copying/pasting into the SE instead of using Script-Only Stacks?
Is there any reason you aren't using the nifty ST connection to LC Server to get LCS to do your parsing for you and then ST to do the indenting?

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 16
Joined: Tue Feb 23, 2010 10:53 pm

Re: Does Livecode have a prettify option?

Post by bobcole » Fri Jul 24, 2020 4:12 pm

What does ST stand for?
the nifty ST connection to LC Server
Thanks,
Bob

bogs
Posts: 4890
Joined: Sat Feb 25, 2017 10:45 pm

Re: Does Livecode have a prettify option?

Post by bogs » Fri Jul 24, 2020 4:21 pm

Heh Mikey, maybe not everyone knows about those things is probably it. I didn't (and still don't), bobcole didn't know about at least one of em.

You just might be a little more advanced than a LOT of others :)
Image

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

Re: Does Livecode have a prettify option?

Post by jacque » Fri Jul 24, 2020 4:59 pm

Slight correction: the tab key formats the handler containing the insertion point. Shift-tab formats the entire script.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Does Livecode have a prettify option?

Post by Mikey » Fri Jul 24, 2020 5:25 pm

ST is Sublime Text.
I am not a fan of being a little more advanced than a lot of others. Let's fix that, and then let's chase Trevor down.

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

Re: Does Livecode have a prettify option?

Post by FourthWorld » Fri Jul 24, 2020 5:42 pm

Mikey wrote:
Fri Jul 24, 2020 2:11 pm
Is there any reason you are copying/pasting into the SE instead of using Script-Only Stacks?
I can think of several, depending on the needs of a given project and team.
Is there any reason you aren't using the nifty ST connection to LC Server to get LCS to do your parsing for you and then ST to do the indenting?
What is the benefit of round-tripping to a server to access a routine available right in the local install?
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/

bogs
Posts: 4890
Joined: Sat Feb 25, 2017 10:45 pm

Re: Does Livecode have a prettify option?

Post by bogs » Fri Jul 24, 2020 5:57 pm

Mikey wrote:
Fri Jul 24, 2020 5:25 pm
I am not a fan of being a little more advanced than a lot of others. Let's fix that, and then let's chase Trevor down.
I am a big fan of you being a little (or in this case, a LOT) more advanced than I am, for instance, I would really shudder if I were the top of the curve, so to speak.

Every day, I am quite thankful there are any number of people that participate here that I learn so much from.

Sublime Text is certainly a top end editor, but isn't everyone's cup of tea, is there a way to duplicate whatever you're using it for in other editors?
Image

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

Re: Does Livecode have a prettify option?

Post by Mikey » Fri Jul 24, 2020 7:11 pm

@4W
The advantage is getting live syntax checking/colorizing/indenting without being locked into the SE, for those people who don't like the SE, or prefer another tool.

@bogs
The LC team prefers Atom. I'm ok with Atom. It's definitely more refined than ST is. It's the muscle car/luxury car or Android/iPhone argument. ST is faster, but you're in the weeds more.
The other reason to use ST is because of a nifty Python script Trevor wrote as a plugin for ST - I don't think it works with Atom, and I was never able to get it to work with Atom - maybe someone else did. The plugin is triggered when you save a file in your project. It then pops a signal on a local network port (i.e. just on your machine). If you are using Levure for your project or if you've copied and pasted the listener code from Levure into your project, the script that you just modified will be reloaded. So you get the benefit of being able to work on scripts in your project in ST, but have them automagically reloaded as soon as you save them, as if you were editing in the SE. The only time this causes a problem is if the script you just modified is the one that LC is busy executing. Then LC will throw up a dialog, and won't reload the script. You would have to quit LC and then go back in.

Any of the editors from the ST/Atom tree (which starts with BBEdit, I believe), are similar enough that they should be able to talk to LC Server to give you syntax highlighting, indenting, etc, however, we are now past my pay grade, so someone else will have to pick it up.

If you prefer Atom, for example, you can install the language-livecode plugin for Atom. Then click on the link in the plugin editor in Atom and there is full documentation.

bogs
Posts: 4890
Joined: Sat Feb 25, 2017 10:45 pm

Re: Does Livecode have a prettify option?

Post by bogs » Fri Jul 24, 2020 8:01 pm

Heh, funny enough you should mention Atom vs. Sublime, I actually prefer Geany, which I am off and on dev'ing a lang pack for. I guess it will now be the muscle car/luxury car/motorcycle or Android/iPhone/dumbphone argument. :D
(Really, from me, did you expect any less?? I can't leave well enough alone *anywhere*) :twisted:
Image

SparkOut
Posts: 2360
Joined: Sun Sep 23, 2007 4:58 pm

Re: Does Livecode have a prettify option?

Post by SparkOut » Fri Jul 24, 2020 9:23 pm

I tried out Atom on Windows. Quite an extensive trial over time. It sucked.
Last edited by SparkOut on Fri Jul 24, 2020 9:24 pm, edited 1 time in total.

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

Re: Does Livecode have a prettify option?

Post by Mikey » Fri Jul 24, 2020 9:24 pm

@sparkOut
What do you use? What didn't you like about Atom?

SparkOut
Posts: 2360
Joined: Sun Sep 23, 2007 4:58 pm

Re: Does Livecode have a prettify option?

Post by SparkOut » Fri Jul 24, 2020 9:28 pm

For LiveCode I use the IDE Script Editor (for all its drawbacks), or for LiveCode Server scripts, as well as general editing and web work, I use VS Code. Apart from anything else, it has the best s/ftp on demand client option that I have found.

Atom was clunky, slow, not intuitive to use, and seemed to be cobbled together from random modules mashed together.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”