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:
- Visual Studio Code
- 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.
Thanks in advance.
Yes... this has been an extremely long-standing bug...
has become second nature to fix this.
Tabs vs. spaces matter. Ignition's code editor prefers tabs.
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.
And also those wanting to delay RSI for a bit longer
Sounds like a job or auto hot keys.
Thank you, and everyone else for the responses.
Disappointed this is a thing.
Is there an un-indent hotkey?
(particularly for the query browser)
When I paste my query to excel, the columns split undesirably.
Sorry, I mean in the query browser with multiple lines that have tabbed in the middle, not indent.
Yes, highlight the lines, shift tab
Shift + tab is not shifting the "as ...." to the left I mean.
The group can move left and right with tab or shift+tab, but the middle tab is not un-tabbing mean.
In some programs, I can use ctrl + i. I don't know the proper terminology.
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.