SlickEdit Product Discussion > SlickEdit®

Indenting with templated types

(1/1)

alex:
Hi, I have a question about how to get indentation to work correctly in the presence of templates.

Here is my problem.  Let's say I have a thing of type FooBar, templated on type Baz, and I want to return an instance of it from a function:

return FooBar<Baz>( a_long_string_of_text_follows );

Then I decide that this really needs to be split up onto multiple lines.  The coding convention at my workplace is to do the following:

return FooBar<Baz>(
    a_long_string_of_text_follows );

Basically, it should be shifted one tab over on the new line.

Unfortunately, when I hit enter following the open paren, I get

return FooBar<Baz>(
                           a_long_string_of_text_follows );

Since we use a lot of templates, this is unbelievably annoying.

I thought I'd solved my problem by going to Tools->Options->File Extensions Setup, going to the Advancedc tab, and then adding '>' to the list of "word chars".  Unfortunately, this hoses tagging for things like foo->bar().  Frustrating.

Is there a way to get this to work as I'd like it to?

SlickEdit Support:
Hi Alex, and all,

Here's a fix file that should remove this annoyance for you.

1.)  Make a backup copy of slickedit\macros\c.e
2.)  Extract and Save the attached c.e file (from attached c.zip) to your slickedit\macros directory.
3.)  In SlickEdit, load this file by navigating to it via Macro-->Load Module.

Hope this helps.
SlickEdit Support

alex:
Thanks, so far it's been working great!

Navigation

[0] Message Index

Go to full version