This seems to be very generic issue related with many different text editors (or maybe copy-paste mechanism in Windows?). Often when I copy-paste fragments of indented code I end up with the first line indented correctly and the rest of lines shifted right by one level and needing manual correction (which is irritating).
For example when I paste code:
int i = 0;
for(; i < 5; ++i){
System.out.println(i);
}
The effect often looks like:
int i = 0;
for(; i < 5; ++i){
System.out.println(i);
}
This problems occurs even when using ultra-advanced IDEs like Eclipse. What is the cause of that problem and why have I had to deal with it for so many years?
The IDE is probably trying to do some sort of smart indenting on your behalf, but in this case it does look like a bug.
The Zeus editor does something very similar.
As an example of what I mean assume you copy this text to the clipboard:
If you then paste that code into into your example in the location shown below:
You should end up with this code (that is what Zeus does):
As you can see this is different from what you may have expected which is this:
That is smart indenting .
There should be an option in the IDE to turn off this feature. Zeus certainly has such an option.