Hi guys, I have a number of macros which move the caret. They would be nicer if they put it back where they found it. Is there a neat way of getting a macro to put the caret and/or selection back where it found it? Failing that, is there an ugly one?
Thanks Robert
On 17 May 2015, at 11:52, Robert Milton wrote:
I have a number of macros which move the caret. They would be nicer if they put it back where they found it. Is there a neat way of getting a macro to put the caret and/or selection back where it found it? Failing that, is there an ugly one?
If you have an existing macro you can locate it in the bundle editor. Here you see an array of commands, insert this as the first command:
{ command = 'setMark:'; },
And then as the last command add:
{ command = 'swapWithMark:'; },
Now running the macro will start by setting a mark (at the current caret’s location) and then end with moving back the caret to this mark.
Beautiful!
On 19 May 2015, at 11:32, Allan Odgaard mailinglist@textmate.org wrote:
{ command = 'swapWithMark:'; },