Posted 18 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
Hi,
I just started using the snippet code you added, and its great. Is there a way to make the snippets automatically tab in to match the parent indentation? For example if I have code like the following:
for(int i=0; i<10; i++)
{
--->
}
The arrow represents a tab and where my cursor is, so if I insert another for snippet I now get:
for(int i=0; i<10; i++)
{
for(int i=0; i<10; i++)
{
}
}
thanks,
Jake

But I would like:
for(int i=0; i<10; i++)
{
    for(int i=0; i<10; i++)
    {
    }
}
[Modified at 10/11/2005 04:29 PM]

Comments (11)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jake, I think I know what you mean and have it on the TODO list but could you edit your message so that you use the code blocks around your code? Without a code block wrapper, the spacing disappears when I read the message. I want to make sure we're talking about the same thing. Thanks!


Actipro Software Support

Posted 18 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
Got it. I didn't look at my post, whoops.
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Actually the first line of the snippet will insert where the caret is so if the caret is after the tab you should currently end up with this:
for(int i=0; i<10; i++)
{
    for(int i=0; i<10; i++)
{
}
}
Right? But nevertheless, it should indent the { and } of the inner "for" snippet as well, which would be a great feature.

How about this, we make a property that when set, will auto-indent the snippet lines (except the first one) to the level that the caret is currently at and will also take into account the indentation level of those lines within the snippet definition?


Actipro Software Support

Posted 18 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
That sounds great. Thanks.
Posted 18 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Just a note... this can already be handled by responding to the events related to a Code Snippet being activated. Can't remember the exact name, but I think it is "CodeSnippetActivated". You can analyze the text currently in the snippet and modify it to place the appropriate number of tabs before each new line in the snippet.

Would still be great to have this feature built-in since it will be so widely used.
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
This feature has been added for the next maintenance release.


Actipro Software Support

Posted 18 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
Thanks.
Posted 18 years ago by Jeff Brown
Avatar
I came here today with the intent of starting a thread regarding this exact issue. And here it is, already. :)

When will that maintenance release be available?
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It's just about ready to go. We are resolving one last issue.


Actipro Software Support

Posted 18 years ago by Jeff Brown
Avatar
This is no time for testing, man! If it builds, ship it! :)
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Well in that case, we'll post it right now! :)

We're just waiting on a customer who found an obscure bug to test our fix.


Actipro Software Support

The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.