[TxMt] Re: End of screen
kerny404 at gmail.com
Sun Jan 18 15:26:28 UTC 2009
Nigel Green wrote:
> Looks good - maybe you need to wrap this around a macro that saves the
> file before it runs. I am guessing that 'wc -l' gives a wrong result
> if its run when the file has been altered but not saved? Best to
> create a macro that sinply saves the file, then a new macro which
> calls the save macro, then runs the code.
> I had a similar problem with the caret moving when I tried to set up a
> macro to fix common typos using sed on save. If you find out how to
> reposition the cursor to where it was when the macro is run, can you
> let me know?
Of course I will.
I tried to register a macro as you said but it wasn't successful..
It just made this
beforeRunningCommand = nop;
command = "tot=$(wc -l $TM_FILEPATH)\ntot=$(echo $tot | cut -d ' ' -f
1)\n# echo $tot, $TM_LINE_NUMBER\nif [ $tot == $((TM_LINE_NUMBER - 1)) ]\n
# we are at the end of the file\nthen\n \truby -e 'puts \"\\n\"*40'\nfi";
input = selection;
name = center;
output = afterSelectedText;
scope = source;
uuid = "29DCBC0A-6C1F-4C0A-A640-767E6A412394";
I don't quite understand where all the macro magic comes from, and why there
almost no documentation about, and how should I know for example what
Where it looks it doesn't say anything about saving file, in fact it doesn't
Moving the caret back to the center it's not so easy apparently, any hints?
View this message in context: http://www.nabble.com/End-of-screen-tp21319865p21528935.html
Sent from the textmate users mailing list archive at Nabble.com.
More information about the textmate