On 4 Mar 2019, at 11:39, Philippe Huibonhoa wrote:

I have a command I'm trying to create that pastes multiple lines of code,
the problem is sequential lines are not indented properly. […]
Is there a recommended way to
fix this?

In the bundle editor’s sidebar, set Format to Snippet (under Output).

Snippet output is automatically indented to the current indent level.

Be aware though that you should escape any special characters in the output that would otherwise trigger snippet functionality, in ruby that could be done with this function:

def e_sn(str)
  str.gsub(/(?=[$`\\])/, '\\')
end