I use Sublime Text 3 as editor and I copy/paste it to the internal Studio script editor.
This line of my code has a manual like break and correct indentation (6 tabs):
ohhh ok, so looks like this is expected. For absolute indentation, the code you paste will be reindented according to the code structure, so the place you paste code is suggested to indent 2 level. I will suggest to do format selection from line 3 - 7.
But this still happens even when the function is very big, i sometimes like having my code spaced a bit to the right.
Sometimes my code automatically spaces a bit to the right and i dont have the motivation to fix it all to the left, so i just keep it like that, but then it will always move pasted code to the left.
well, the spirit of absolute indent rule actually doesn’t expect user to do any manually indent by themselves, because editor should handle all of it! It indents according to the code structure, so it may looks weird if you are using absolute indent but still do some manually indent.
But I am still curious in what situation you still want to do manually indent after editor formatting
Thanks, however, it’s not preserving the original tabs when pasting a code, like described in OP.
For example, currently, if I copy (from an external editor) and paste a multi-line instruction with 6 tabs in the second line (as the original image in OP) and then paste it into the Studio Editor, it’s being transformed into 3 tabs, losing the original indentation. @yohooyohoo
We will give 1 extra indentation from the first line of multi-line statement if you just paste code after first line. If you paste code after second line which has been indented manually, editor should align to the second line.
For example:
Objeto.CFrame = CFrame.new(Vector3.new(Pos3D.X, Objeto.Position.Y, Pos3D.Y)) *
CFrame.Angles(0, math.rad(Item.OrientationY), 0) *
|<- paste code here, editor will align with second line
The problem is simple: studio editor should preserve 100% of the pasted code, and it’s not happening. When a text is pasted, it should not be changed.