Allow external editor for customization scripts

Requests or suggestions for new features
Post Reply
Posts: 21
Joined: 29 Oct 2014, 23:06

Allow external editor for customization scripts

Post by mfloyd » 02 Nov 2015, 22:30

I would like to use an external editor for editing customization scripts. I understand the reason why it has not been done yet: As soon as the script has been closed it will be re-initialized immediately and begin running continuously. I think a similar thing can still be done while allowing external editors to edit them. I think it would require detecting whether any changes in the customization scripts have been made whenever Vrep receives focus. Notepad++ detects whenever changes happen to files it has open whenever it receives focus and then asks a user of they should be reloaded if they have changed.

The process to edit customization scripts would then look something like this:
In vrep, the customization script is opened in an external editor. Vrep would loose focus to the external editor. The user edits the script (or not). The user then clicks on the vrep window and vrep receives focus. Vrep detects that it has received focus and checks to see if the customization script has been edited. If the script has been edited it re-initializes and runs the script.


Site Admin
Posts: 7020
Joined: 14 Dec 2012, 00:25

Re: Allow external editor for customization scripts

Post by coppelia » 03 Nov 2015, 10:33


yes, this could be done. But a simple workaround would be to put following code in your customization script (or any embedded script for that matter):

Code: Select all

local f = loadfile('myEmbeddedScriptCode.lua')
return f()
You can then have all your relevant code located in external files, and use whatever editor you wish.


Post Reply