Thanks again FichteFoll. You are a great fount of knowledge I must say!!
So I’ve followed your advice and it almost works . My macro now looks like this:
{"command": "set_setting", "args": {"setting": "auto_indent", "value": false} },
{"command": "move_to", "args": {"to": "hardbol"} },
{"command": "insert_snippet", "args": {"name": "Packages/User/mysnippet.sublime-snippet"} },
{"command": "set_setting", "args": {"setting": "auto_indent", "value": true} },
]
The theory is that by setting auto-indent to false, then moving to ‘hardbol’ the (multi-line) text I insert will be inserted at character position 0, and line up there correctly. However, the auto-indent seems to be ignored from within the snippet. So I get a translation from
if (some condition)
{
a line of code
another line of code
to
[code] if (some condition)
{
my snippet line 1
my snippet line 2
my snippet line 3
a line of code
another line of code[/code]
whereas what I want is
[code]if (some condition)
{
my snippet line 1
my snippet line 2
my snippet line 3
a line of code
another line of code[/code]
If I insert the lines manually with auto-indent off, it works fine. Any suggestions?