I have a command I'm trying to create that pastes multiple lines of code, the problem is sequential lines are not indented properly.  If my command pastes 1, 2, 3 on newlines for example, I'll get something like this:

def foo
   1
2
3
end

since I invoke my command from the proper indenting (2 spaces over), but the following lines are not indented at all.  Is there a recommended way to fix this?

Thanks!