Author Topic: Indenting with templated types  (Read 3616 times)

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
Indenting with templated types
« on: August 03, 2006, 08:00:02 pm »
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

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 259
  • Hero Points: 24
Re: Indenting with templated types
« Reply #1 on: August 04, 2006, 03:32:13 pm »
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

  • Community Member
  • Posts: 64
  • Hero Points: 6
Re: Indenting with templated types
« Reply #2 on: August 04, 2006, 06:07:07 pm »
Thanks, so far it's been working great!