Author Topic: SE18-Auto beautify doesn't use my default beautify setting  (Read 2764 times)

wangsitan

  • Community Member
  • Posts: 15
  • Hero Points: 1
SE18-Auto beautify doesn't use my default beautify setting
« on: July 19, 2013, 04:51:25 am »
"Beautify while typing" and "beautify on paste" are valid, but the format after beautified is different from my default setting. I have to press my hotkey for beautifing to change the format.
How to let it to use my default beautify setting?

Language: C/C++
« Last Edit: July 19, 2013, 04:55:33 am by wangsitan »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1125
  • Hero Points: 105
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #1 on: July 19, 2013, 01:05:19 pm »
Do you have an example that is handled differently on typing than when you beautify the entire file? 

The only known difference between the two I'm aware of is an instance where the indent can go wrong inside of a case statement that has braces in it.  The hotfix for that is in progress.

wangsitan

  • Community Member
  • Posts: 15
  • Hero Points: 1
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #2 on: July 20, 2013, 10:07:57 am »
If I paste one line like this, it's all correct:
char* p1 = (char*)s1; //same as my default beautify settings

But if I paste this line, it's different:
wchar_t* p2 = (wchar_t * )s2; //there are 2 more space characters around '*'

Then I press ctrl+Y (my hotkey for beautify-selection), this line becomes:
wchar_t* p2 = (wchar_t*)s2; //OK


The configurability of beautify in SlickEdit is really amazing XD
I have some other questions about auto beautify. And I'm worring about my poor English...
« Last Edit: July 20, 2013, 10:56:35 am by wangsitan »

wangsitan

  • Community Member
  • Posts: 15
  • Hero Points: 1
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #3 on: July 20, 2013, 11:01:31 am »
Indent also can go wrong on 'for' and 'if'
I'm tring to make it reappear ::)

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1125
  • Hero Points: 105
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #4 on: July 22, 2013, 01:48:15 pm »
I can reproduce the pasting problem.  It almost looks like we're sending an incorrect range of text to the beautifier, and then the beautifier doesn't parse it correctly.  If that's the case, it might also be the cause of the for and if pasting problems as well. 

Thanks for the report.  I'll look at that today, and let you know if it's going into a hotfix, or a point release.


wangsitan

  • Community Member
  • Posts: 15
  • Hero Points: 1
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #5 on: July 22, 2013, 02:50:26 pm »
I reproduced it.
code like this:
void func()
{
    for(; true;)
    {
        if( true ) //cursor is on the tail of the line
    }
}

then I press Enter and '{', it becomes:
void func()
{
    for(; true;)
    {
 if( true )        //there's one space character before 'if', what I want is 2 tabulators like the next line
        {
        }
    }
}

then press the hotkey for beautify, it becomes:
void func()
{
    for(; true;)
    {
        if( true ) //OK
        {
        }
    }
}


My beautify settings about this:
[Indent]-[General]-[Indent with]: Tabs
[Indent]-[General]-[Syntax indent]: 4
[Indent]-[General]-[Tab stops]: +4
[Indent]-[General]-[Line continuation indent]: 4
[Indent]-[General]-[Use current tab setting]: Off
[Indent]-[General]-[Original tab size]: 4

Language(C/C++) settings about this:
[Insert real indent]: Yes
[Beautify while typing]: Yes
[Use adaptive formatting]: No
[Auto-Close]-[Brace{}] (enabled and checked): On next line



Thanks for your reply.

//==============================
Information above is out of date.
« Last Edit: July 29, 2013, 08:04:16 am by wangsitan »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1125
  • Hero Points: 105
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #6 on: July 22, 2013, 04:07:58 pm »
I haven't reproduced this.  It could be some setting you didn't list is interfering somehow. 

If you could,  post your $(SLICKEDITCONFIG)/vusr_beautifier.xml file, and I'll see if I can reproduce it with your profile.

wangsitan

  • Community Member
  • Posts: 15
  • Hero Points: 1
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #7 on: July 23, 2013, 03:25:04 pm »
I can reproduce it at home and cannot do it on my office computer. The difference is, I installed hotfix(3 July 2013) for SE18 on my office computer 2 or 3 days ago. I'll try this at home now. The attach is the file which has the problem.

//=========
Loading hotfix doesn't help for this. ::)

//==============================
Information above is out of date.
« Last Edit: July 29, 2013, 08:04:28 am by wangsitan »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1125
  • Hero Points: 105
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #8 on: July 25, 2013, 02:16:01 pm »
I was wrong about the pasting problem, it won't be hot-fixable.  I'm working on getting it fixed for 18.0.1 now.

wangsitan

  • Community Member
  • Posts: 15
  • Hero Points: 1
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #9 on: July 28, 2013, 04:30:52 pm »
I installed SE18 on a clean system in a virtual machine and set the beautify options one by one according to my old settings. It took me long time to ensure the settings of them are same. The bug didn't appear on the new system.

I think there was something wrong with my old "vusr_beautifier.xml". The new xml only has one profile:
<profile name="My Default" lang="c">.

But my old xml has both
<profile name="My Default" lang="c"> //lost some attributes
and
<profile name="My Default" lang="m"> //has a lot of attributes

I think lang="c" is for C/C++. But I don't know what "m" is for.

This issue may be related to my old version of SlickEdit. I installed SE17, 16, even maybe 15 on this system before.

The bug disappeared after I replaced this xml with the new one. Thanks for your attention.

« Last Edit: July 29, 2013, 08:00:30 am by wangsitan »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1125
  • Hero Points: 105
Re: SE18-Auto beautify doesn't use my default beautify setting
« Reply #10 on: July 29, 2013, 01:34:40 pm »
Thanks for the update.  I can agree with what you've said, so far I can only reproduce it with your configuration.  I'm still trying to work out how it's happening.  I did remove some settings that were dead or duplicates between v17 and v18, but I'll double check your config too see what extra settings it has and if they're somehow related to this problem.

I'm glad you got it working for you. 

Also: the fix for the pasting problem is now in for the v18.0.1 patch.   


Edit:  Oh, the 'm' you saw as the value of 'lang' in the profile is the language mode name for Objective-C.  It will have more settings than C++,  because it adds settings for Objective-C/C++ constructs in addition to all of the C/C++ settings.
« Last Edit: July 29, 2013, 01:38:51 pm by patrick »