Getting Errors on idents and it doesn't make sense

Hello all,

I've been bumping into this "bug" over and over again and its starting to pester me. For whatever reason, and I've noticed it happens more when you copy paste things in the script editor, I get errors regarding indentation.
Capture

As you can see, the ParentFolder function needed to be spaced over a bit.. There is absolutely no reason for it to need to be indented like that, NONE WHATSOEVER. :angry:

Is this going to cause issues for production? I have bits and pieces of code like this in other projects as well. If one day this bugged is fixed are our current projects going to crash and result in loss of production?

Long-standing problem. Not simple to fix while retaining any auto-indent behavior. It has gotten better in recent versions.

You bet it will. Get used to fixing indentation after pasting code. :man_shrugging:

:sob: :smiling_face_with_tear:

1 Like

The secret is to highlight the entire code block with the desired indentation:
image

Then, in the area where it is to be pasted, make sure there is no indentation at all:
image

When it's done this way, the indentation doesn't get messed up:
image

Copy the entire block even if the indentation of the code that is being copied doesn't match the indentation level that it will need when pasted because the original indentation will be preserved. In this way, the pasted code block can simply be highlighted and moved to where it needs to be with tab or shift-tab.

3 Likes