Re: Custom formatting under version 7.0? [message #57185 is a reply to message #57164] |
Thu, 06 December 2007 08:54   |
Jim Pendleton, ITT Vi
Messages: 13 Registered: August 2006
|
Junior Member |
|
|
"Pierre" <pierre.villeneuve@gmail.com> wrote in message
news:86914214-2396-4802-bbdb-3398335b3805@v4g2000hsf.googleg roups.com...
> On Dec 5, 9:09 am, Doug Edmundson <do...@ittvis.com> wrote:
>> Pierre wrote:
>>> On Dec 4, 2:40 pm, sboli...@gmail.com wrote:
>>>> On Dec 4, 2:45 pm, Pierre <pierre.villene...@gmail.com> wrote:
>>
>>>> > I have been using the new eclipse-based DE for the past few days and
>>>> > overall I like what I see. One thing I can't figure out yet is how
>>>> > to
>>>> > modify the auto-formatting rules to force my code to line up with
>>>> > parentheses, like this:
>>>> > res = my_func(arg0, arg1, $
>>>> > key1 = key1, $
>>>> > key2 = key2)
>>>> > I would like the lines that follow an open parenthesis to
>>>> > automatically indent to that same column. I don't know if the above
>>>> > example will show it since it probably depends on viewing this post
>>>> > with a fixed width font.
>>>> > Anyhow, does anyone know if this is even possible with the new DE?
>>>> > Thanks!
>>>> > Pierre
>>>> Pierre,
>>
>>>> Unfortunately, the auto-formatter is not that sophisticated at this
>>>> point in time.
>>>> It will just identify an IDL line as a continuation of a previous
>>>> line, and
>>>> then indent by the amount dictated by the preference IDL->Editor-
>>
>>>> > Displayed tab width
>>>> -Scott
>>
>>> Thanks for the reply Scott. Is it at all possible to modify the
>>> formatting rules from the user's end, or are they currently "hard
>>> coded" into the system?
>>
>>> -Pierre
>>
>> Hi Pierre,
>>
>> Now might be a good time to bring up code templates. They don't resolve
>> formatting issues, but you might find them useful.
>>
>> If you hit ctrl+space while focused in an editor, a context menu will
>> pop up. Normally this is used for word completion, but if you haven't
>> typed part of a word yet, the full list will start with several
>> templates. The IDL Workbench has the following templates built-in:
>>
>> CASE, CATCH, FOR, FUNCTION, IF, PROCEDURE, REPEAT, SWITCH, and WHILE
>>
>> If you select one of those, code will be inserted for you. It's great
>> if you can't remember the syntax for if-then-else. Note that some of
>> them allow you to select text and then apply the template. For example,
>> if you have "a = 1", select it and apply "IF", that text will be put
>> into an IF statement.
>>
>> Note that if you type some letters and then press ctrl+space, the pop-up
>> list will trim the list of matches down.
>>
>> The on-line documentation goes into more of the details. One thing you
>> can do is create your own templates. A good use of this might be to
>> insert standard code, comments, copyrights, etc. For more templates, go
>> to Preferences > IDL > Templates. The little "?" in the lower left will
>> bring up the documentation.
>>
>> Doug
>
> Hi Doug,
>
> I had noticed the templates menu and I have started using them. I am
> always forgetting exactly how to set up case statements, and this has
> made it easier for me.
>
> -Pierre
To follow up on Doug's comment, creating templates for IDLdoc-style
comments also helps discourage laziness in documenting one's code.
Now if only I could attach keyboard accelerators to individual template
insertion commands...
Jim P.
|
|
|