Re: macro to go to the end of the line, but before the comment
Brought to you by:
set
From: Salvador E. T. <sal...@in...> - 2006-09-19 19:37:30
|
Hi! On 02/09/06 08:59, Szasz Pal wrote: >Hi! > >I was wondering if it would be possible to write a simple macro to go to >the end of the line, but before the comment. >Ie. if I have a line like: > > int d2 = b*b + c*c; // calculates the distance's square > >Now, if I press END, the cursor goes after the "square". >What am I thinking is if I press CTRL+END for example, the cursor would >go after the "c*c;" > >Is it possible? > > I think the following macro works: (defmacro 'Move End' (eval (SendCommands cmcLineEnd) (= "stx" (GetSyntaxAtCursor)) (if (& stx (| edfInsideCom edfInsideCom2 edfComInside)) (eval (loop (= "stx" (GetSyntaxAtCursor)) (ShowInStatusLine (+ "" stx)) (if (not (& stx (| edfInsideCom edfInsideCom2 edfComInside))) (exitloop)) (if (== (GetCursorX) 0) (exitloop)) (SendCommands cmcCharLeft) ) (SendCommands cmcCharLeft cmcCharLeft) ) ) ) ) Isn't perfect, by I think it will do the job for the case you mention. SET -- Salvador Eduardo Tropea (SET). (Electronics Engineer) Visit my home page: http://welcome.to/SetSoft or http://www.geocities.com/SiliconValley/Vista/6552/ Alternative e-mail: se...@co... se...@ie... Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013 |