سؤال

I use the tag in Netbeans to fold custom segments of code to structure my doc a bit. The functionality of it is great, BUT everytime I insert the tag, the code inside this tag becomes formatted in a way that I don't like, e.g:

this is how I write it:

if(foo==bar)
{
   //do something
}
else
{
   //do anything
}

After inserting the editor-fold this piece of code reads:

if(foo==bar)     {
   //do something
}      else      {
   //do anything
}

Maybe this is how 'professional coders format their if-statements, but I like the upper better, I am familiar with it. Is there a possiblity to prevent netbeans to format my code when inserting a editor-fold?

هل كانت مفيدة؟

المحلول

Tools -> Options -> Editor -> Formatting

You can set things the way you like there.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top