I'm currently using Ignition version 8.1.32, and I've noticed that this issue persists in older versions as well (down to at least 8.1.21). Both my colleague and I have encountered problems when copying and pasting scripts into Ignition's editor. At this point, we haven't tested if the issue also occurs in the console.
Specifically, we're experiencing erratic indent and dedent errors that seem to appear randomly. The usual methods of fixing indentation, such as untabbing and retabbing, don't seem to work. If retabbing the code was all I had to do, then sure, I'd be fine with it. But that's not the case, and it's driving me bonkers. We find ourselves having to delete line breaks manually, one at a time, which is far from efficient.
This issue occurs regardless of the source from which we're copying the script:
Websites
Visual Studio Code
Notepad++
Even other Ignition scripts
So, are we overlooking something here? Could this be a bug, or is it possibly an issue on our end? My preferred workflow involves using VS Code and then pasting the code into Ignition, but currently, even pasting from Ignition to Ignition is problematic.
Any insights or solutions would be greatly appreciated.
The secret is for no tab or space to be present on the line you are pasting to. If it's a truly blank line with no tabs or spaces, the tabs of your clipboard text will be precisely preserved following the paste.
While I'm not the go-to expert on this, I've got to say, VS Code really shines for tasks like this. One of the cool features is being able to select and edit multiple lines at once.
You've got a couple of ways to do this: either use a keyboard shortcut or simply hold down the middle mouse button to make your selection. Once you've done that, you can type, tab, or space out everything on those lines as much as you like. It's a handy trick for making quick edits or formatting your code just the way you want it.