I have gotten very used to a specific process while I'm writing Python code. Namely, anytime I use characters that are used in pairs I'll just quickly add them both first and then add the content between then (i.e. { }, ( ), " ", ' ', etc.).
Recently there's been an update where I've noticed that the script will auto-complete these special characters and add the closing character for you, so often times I'll end up with {}} instead of {}.
There was also a feature added to auto-wrap strings in quotes if you highlight the string and press quote. This can be annoying at times as well.
Basically no, although I'm sure @justinedwards.jle can cook something up.
To give a starting point, you'll need to find every com.inductiveautomation.ignition.designer.gui.tools.PythonTextArea,
call its' getTextArea() method to retrieve the inner RSyntaxTextArea, then setInsertPairedCharacters(false).
You might be able to do something fun with com.inductiveautomation.ignition.designer.gui.tools.PythonTextArea.Companion.INSTANCE, which should (somewhere in memory internally) have a list of open PythonTextArea instances, but it won't be super easy to get at.
In some future release I could add the ability to toggle this behavior to the right click 'options' menu you get, but it won't be for some time, and it's pretty low priority (unless more people are annoyed by it and just haven't said anything).
I haven't experienced it as it must not be in the version I am using. I tend to do the same thing as @amarks, and would find it annoying until I just decided to get used to it.
When I'm using a function like system.gui.color, I often ignore the auto complete and type my numbers in directly, so I end up with something like this: system.gui.color(240, 240, 0 green, blue, alpha). Then, on the last character, I'll intuitively press shift + end to highlight the unwanted text red, green, blue) expecting it to vanish when I type the last character ).
...but the unwanted text doesn't vanish. Instead, the closing parenthesis is not administered, and my cursor is simply kicked down to the next row leaving all of the unwanted text unaltered.
The other Ignition auto-complete related thing that trips up my flow are floats. I'll be typing a float and, when I hit the decimal key, the auto complete pops up and sometimes gets in the way.
I imagine these occurrences are the natural result of switching back and forth between development software. Similar things happen to me when I switch OS environments. For example, keyboard shortcuts sometimes don't do what I want them to do because I've somehow mixed up the cmd and ctrl keys .
I couldn't find that attribute, but I was able to disable the autocomplete for any open script editor by running this script in the script console:
def getAllComponentsOfClass(container, className):
foundComponents = []
for component in container.components:
if component.__class__.__name__ == className:
foundComponents.append(component)
else:
foundComponents.extend(getAllComponentsOfClass(component, className))
return foundComponents
from java.awt import Window
for window in Window.getWindows():
scriptEditors = getAllComponentsOfClass(window, 'PythonTextArea$textArea$1')
for editor in scriptEditors:
for listener in editor.document.documentListeners:
if listener.__class__.__name__ == 'AutoCompletion$AutoActivationListener':
editor.document.removeDocumentListener(listener)
It simply removes the listener responsible for auto completion from all of the open script editors.