Re: Custom formatting under version 7.0? [message #57321 is a reply to message #57160] |
Wed, 05 December 2007 09:09  |
Doug Edmundson
Messages: 58 Registered: November 2005
|
Member |
|
|
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
|
|
|