Coming in 8.1.18: Script editor improvements

You can move selected code right or left. Move right with TAB and move left with SHIFT + TAB.

4 Likes

True but beware, especially of the first line - still messy when pasting blocks of code to match the indent level of the destination.

3 Likes

The thing is that this even happens when you copy the script from an event handler into another event handler, you still get the indents which you need to bulk select and shift+tab back which is mildly annoying.

4 Likes

:cough: dark modeā€¦ :cough:

4 Likes

You young whippersnappers need to kick that habit. Induces eyestrain, headaches, and early onset presbyopia. Bright backgrounds with dark text are always superior. Look up how camera aperture affects depth of field and apply that to a human's pupils.

9 Likes

:slight_smile:

1 Like

Dark mode was actually kicked around a little bit, but having it just in script editors didnā€™t really make sense. The entire rest of the designer would still be locked in ā€˜light modeā€™, so itā€™d just be weird. And having theming support for the entire designer is basically a non-starter; itā€™s too tied into Vision.

No weirder than this:

1 Like

Yeahā€¦ you canā€™t do that anymore :see_no_evil:

2 Likes

I'll still take just editors over nothing :stuck_out_tongue: haha!

@PGriffith
Been using 8.1.18 on Windows machines and Iā€™m loving the new editor. However there is one change/regression that is bugging me.

On prior script editors, the opening parentheses, curly braces, brackets etcā€¦ are highlighted when you are one the closing of the same. However in 8.1.18 it doesnā€™t seem to be doing that.

Example:

8.1.11
ScriptEditor_8_1_11

8.1.18
ScriptEditor_8_1_18

On longer statements it is super handy to try and find those errors where you are missing a closing braces or something.

Any idea if this is getting put back in? Or is there a setting Iā€™m missing to bring this back?

10 Likes

Updated to 8.1.18 yesterday, I was excited to use the new editorā€¦

But the first frustration came very quicky:
start typing "{}".formatā€¦


Oh cool, autocompletetion and all !

type the first parenthesis, end up with this:
image

Wait, what just happened ?

edit: little gif showcasing it. Iā€™m not pressing enter or selecting anything, just typing my regular .format().
wtformat

1 Like

And another thingā€¦

When opening up a scripts that is quite longā€¦ the right hand side where there are normally all the functions created by the script is blank. This is super annoying.

It does throw and error in the designer console:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at org.fife.ui.rsyntaxtextarea.folding.PythonFoldParser.getFolds(PythonFoldParser.java:87)
	at org.fife.ui.rsyntaxtextarea.folding.DefaultFoldManager.reparse(DefaultFoldManager.java:445)
	at org.fife.ui.rsyntaxtextarea.folding.DefaultFoldManager$1.parse(DefaultFoldManager.java:477)
	at org.fife.ui.rsyntaxtextarea.ParserManager.actionPerformed(ParserManager.java:163)
	at java.desktop/javax.swing.Timer.fireActionPerformed(Unknown Source)
	at java.desktop/javax.swing.Timer$DoPostEvent.run(Unknown Source)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at com.inductiveautomation.snap.swing.RibsEventQueue.dispatchEvent(RibsEventQueue.java:99)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

2 Likes

Can you post (or DM me) the script you're using here?

Thanks to @bschroeder and @mazeyrat for sending in samples (and @bschroeder for noticing the crucial insight) - the issue with parsing is with continuation lines/expressions wrapped to multiple lines. Iā€™m going to do my best to work around it (ideally for 8.1.19) but for now, avoid patterns like this:

for key in ["abc-%s" % site,
			"def-%s" % site,
			"ghi-%s" % site]:

Or other continuations with mixed indentation:

def abc2():
	doSomething(
			a,
		)
	
2 Likes

Coming soonā€¦

25 Likes

VERY cool! Definitely excited for this one!!

Really cool, super excited for this. I see you keep showing it in script editor/script console. I assume (hope) this functionality extends when I am writing a script on a button onAction? That is what irks me the most currently - having to switch from a vision window to the script library to see my functions documentation.

Hi! Iā€™ve encountered this bug wherein the right side of the Scripting is empty. This applies to all of our projects and scripts under Scripting.

Read like 4 posts up where this exact bug is addressed.

4 Likes