On Apr 7, 2007, at 5:11 PM, Simon Strandgaard wrote:
Thanks Jacob, this works much better than what I had before :-)
Still, any ideas how to jump between beginning of line and beginning of text ? (aka. smart-home in the pc world)
This is an interesting problem... does anyone know how to set up a macro to make a decision based on a condition?
Or maybe how to achieve this as a command rather than a macro?
So far what I've thought up: Do the macro as before, and then cmd- shift-left. From there pressing left will home to the beginning of the line, pressing right will home to the beginning of the text. Also on the first step instead of moving to the beginning of the line, again cmd-shift-left, and copy to clipboard. This will give you something to compare to for the last step, if they're the same, then press right. If they're different, press left... I don't see how this can happen in a macro though.
For a command is it possible to find the current column location of the cursor? also is it possible to move the cursor around without affecting any of the text? (or at least perceivably not affecting any of the text)...
Just had another idea for a macro... Not 100% sure this can work, but... can you have a 'search for text in clipboard' or something equivalent? then we can search for [^ \t]|^*pasted text* where *pasted text* is the current word (or cmd-opt-shift-left)... That way it will jump to the first non-space character (beginning of text), unless the only thing to the left of the cursor are non-space characters, in which case it will jump to the beginning of the line (based on the greedy nature of regexps)?