Author Topic: C# Beautify problem  (Read 2350 times)

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
C# Beautify problem
« on: May 10, 2010, 01:03:08 pm »
SlickEdit Version 15.0.0.5    Build Date: April 26, 2010
Emulation: Vim

OS: Windows Vista    OS Version: 6.00.6002  Service Pack 2
Project Type:
Language: .cs (C#)

Hotfixes:
C:\Users\Administrator\Documents\My SlickEdit Config\15.0.0\hotfixes\hotfix_se1500_3_cumulative.zip (Revision: 3)

Tools->Beautify... dialog ("C# Beautifier"), Other tab.  "Indent preprocessing" is CHECKED, Indent with Tabs is not checked.
Before beautifying:
Code: [Select]
void main()
{
    try
    {
        #region INDENT_ME
        int a;
        doSometthing();
        #region
    }

    catch ()
    {
    }
}
After beautifying:
Code: [Select]
void main()
{
    try
    {
#region INDENT_ME
        int a;
        doSometthing();
#region
    }

    catch ()
    {
    }
}

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: C# Beautify problem
« Reply #1 on: May 11, 2010, 02:36:58 pm »
Unless you specify "Indent inside block" along with "Indent preprocessing", preprocessing in scoped blocks ("{}
") are back-indented starting at column 1.  Is that the behavior your looking for? 

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: C# Beautify problem
« Reply #2 on: May 11, 2010, 02:48:55 pm »
Thanks for the reply.
Unfortunately, checking "Indent inside block" doesn't change the behavior.  I'm looking for formatting as in my top sample, but I keep getting the formatting shown in the second sample.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: C# Beautify problem
« Reply #3 on: May 11, 2010, 03:29:06 pm »
I see, we don't really have an option to align the PP to the scoped brace indent level in the Beautifier.  The "Indent Preprocessing" is useful for indenting the nested preprocessing if/ifdef/ifndef levels:

Code: [Select]
#if 1
    #ifndef _YYZ
        #ifdef _DEBUG
        ...
        #endif
    #endif
#endif

I will have to file it as feature request, I'll document it if there's not already one there.