Scripting - Copy/Paste with automatic indents

This is a pretty minor issue, it’s more of an annoyance, but would save time if it was addressed.

In Ignition scripting, pressing enter typically takes me to the correct indentation level for the code (as opposed to the leftmost point of a line). However, when copying and pasting, the pasted code is always too indented. It seems to be taking the indentation from the copied code and ALSO applying the automatic indentation. It doesn’t affect the first line, but all lines afterward have an indentation issue. When I have a small code snippet I want to duplicate several times, the indentation cascades for each paste, causing a minor hassle to adjust it to a correct format.

Ya, that has been happening for a long time.

This is till a problem. Any chance of getting it fixed? Is anyone aware of any kind of a work around?

Thanks.

I always place a pound sign (#) in the first column above where I paste. /-:

3 Likes

There’s an active ticket to homogenize the script editors used in the designer with the “newer” editor (try right clicking the script console or named query editor). This newer editor should resolve a lot of minor issues (ie, docstrings causing the syntax highlighting to go haywire) and hopefully the issue with copying and pasting as well.

Which class is that new editor, if you don’t mind?

The newer editor is the CodeEditor, which, like I said, is currently only used in the script console and named query editor.

1 Like