Code window improvements

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

Post Reply
jmk_phd
Posts: 27
Joined: Sat Apr 15, 2017 8:29 pm

Code window improvements

Post by jmk_phd » Sat Aug 05, 2017 6:37 pm

For me, two of the most frustrating features of the LC code window are (1) that the recent history of script tabs is not saved when one quits and relaunches LC, and (2) that there is no split-screen feature that, for example, enables one to view script variables declared at the top of the script while employing these a hundred lines down the code.

Seems to me that each of these improvements could be implemented without much trouble.

(1) I make a working copy of my LC file after each major edit, so that I can I can revert back in case I've screwed up. However, that copy does not include a history of the scripts that I'd had open for editing. Consequently, I've got to figure out from scratch which scripts I'd had opened for editing. It would be great if LC saved and restored the history of recently displayed scripts, just as some apps track recently opened files.

(2) I've been employing script-local variables as an alternative to the global variables disparaged in the LC documentation. However, when a script runs a few hundred lines, it is extremely inconvenient to scroll up and down between the declared script variables and the handlers invoking those variables. Life would be much simpler if LC implemented a split-screen -- much like many word-processing apps -- so that we could display these declarations at the top of the script window and still display the script currently being constructed below.

I hope that the LC developers will address these issues.

jeff k

mrcoollion
Posts: 279
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Code window improvements

Post by mrcoollion » Sat Aug 05, 2017 7:07 pm

I had the same issues and at one time almost lost a huge amount of work.

My current solution is a free Windows only application called Cobian Backup http://www.cobiansoft.com/index.htm.
This application is able to copy a changed file in a folder (stack) every x minutes to a backup location.
Now I can always refer back to any previous version of my stack in increments of x minutes back in time :D

For me at this moment it is sufficient and it has saved my bacon on several occasions.

Maybe this is a solution for you as well.

Regards,

Paul

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

Re: Code window improvements

Post by FourthWorld » Sat Aug 05, 2017 9:08 pm

I've found Nextcloud a game-changer:
https://nextcloud.com/

It updates and syncs folders across any number of machines. I use it to sync my LiveCode Plugins folder and work folders - everything stays current, and I have one more backup.

Nextcloud does a lot more besides (they have a large and growing number of third-party apps), all free and open and unlike pubic clouds it's completely under your control.
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/

jmk_phd
Posts: 27
Joined: Sat Apr 15, 2017 8:29 pm

Re: Code window improvements

Post by jmk_phd » Sun Aug 06, 2017 8:29 am

Thanks much to Paul and Richard for your replies.

However, as best I can tell, the suggestions offered do not address the issue I'd raised regarding saving a record of recent scripts (tabs) in the Code window.

As long as one does not quit LC, the "Recent Scripts" (clock-like icon) button in the Code window menubar retains a list of (at least) the 14 most recent scripts opened.

However, that list is *not* saved and restored when one quits and reopens the main stack in LC -- whether the original or a backup copy.

The feature that I'm requesting is simply that LC save this list of recently opened scripts to some kind of preferences or application support file, so that when it is reopened (or copied) this list of recently opened scripts is still available.

Currently, before I save and close a LC file, I've got to jot down on paper all open tabs in the Code window, just so I know which scripts I need to open again to continue editing once I reopen that LC file.

jeff k

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2432
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Code window improvements

Post by richmond62 » Sun Aug 06, 2017 9:45 am

Cobian Backup and so on are effective for keeping backups.

However it is entirely possible to get that sort of thing going in LiveCode itself (I've done it twice but cannot lay my hands on the stacks).

AND, NO, it doesn't help with a request for a record of recent scripts in the code window.

I think this may be problematic as the code window (aka scriptEditor) is NOT part of the stack being edited.

Were the code window part of the stack being edited it could save records of recent scripts within the relevant stack.

HOWEVER if your stack were saving recensions of scripts within itself say every 15 seconds it would soon be
bloated beyond belief.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2432
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Code window improvements

Post by richmond62 » Sun Aug 06, 2017 10:06 am

Ah: Gottit:

http://forums.livecode.com/viewtopic.ph ... ol#p146670

The Dropbox location is still valid.

shaosean
Posts: 905
Joined: Thu Nov 04, 2010 7:53 am

Re: Code window improvements

Post by shaosean » Sun Aug 06, 2017 11:13 am

jmk_phd wrote:The feature that I'm requesting is simply that LC save this list of recently opened scripts to some kind of preferences or application support file, so that when it is reopened (or copied) this list of recently opened scripts is still available.
This really shouldn't be too difficult to implement..

shaosean
Posts: 905
Joined: Thu Nov 04, 2010 7:53 am

Re: Code window improvements

Post by shaosean » Sun Aug 06, 2017 11:59 am

Spent a few minutes on this and here is what you would need to do (this may or may not work and/or break the IDE, but should be fine).. The only thing I didn't bother working on was figuring what Script Editor window is in use, so you can do that.. In all the sample code below you will need to replace the # symbol with the actual number associated with the script editor window (if you have one script editor window open, it'll probably be 1)..

To get the history:

Code: Select all

put value("seHistoryGet()", stack "revNewScriptEditor #") into aVariable
To get the history to load, you'll need to a custom property, on the revPreferences stack (which is where they save the history anyways), and then force the history to be loaded..

Code: Select all

set the cScriptEditorHistory of stack "revPreferences" to aVariableContainingYourHistory
send "seHistoryLoad" to stack "revNewScriptEditor #"

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

Re: Code window improvements

Post by jacque » Sun Aug 06, 2017 4:55 pm

I know this isn't the solution to your request, but for future reference, LC ships with an auto-save plugin. Look in the Plugins menu. You can set the save interval to the number of minutes between saves.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

shaosean
Posts: 905
Joined: Thu Nov 04, 2010 7:53 am

Re: Code window improvements

Post by shaosean » Mon Aug 07, 2017 2:29 am

You can also look at overloading the Save and duplicate the stack before saving the changes..

jmk_phd
Posts: 27
Joined: Sat Apr 15, 2017 8:29 pm

Re: Code window improvements

Post by jmk_phd » Wed Aug 09, 2017 11:01 pm

Thanks again to everyone who contributed solutions to the minor annoyance that the history of opened scripts is lost when one duplicates an LC mainstack file in the Mac Finder (and presumably in whatever is the Windows equivalent).

The suggestion to do instead a "Save as..." from the LC menu -- saving the mainstack file to a newly-created folder/directory under a different name -- does indeed retain in that copy the history of recently-opened scripts (in the dropdown menu in the upper right corner of the code-editing window). This is indeed a better (and less tedious) alternative to jotting down a list of recently-opened scripts and having to reopen each one manually via the Project browser.

Not for the first time, I'm deeply indebted again to your generous support.

jeff k

Post Reply

Return to “Feature Requests”