Author Topic: SE18-Beautify bug on 'return' statement  (Read 2150 times)

wangsitan

  • Community Member
  • Posts: 15
  • Hero Points: 1
SE18-Beautify bug on 'return' statement
« on: July 20, 2013, 10:44:28 AM »
code like this:
bool funcB()
{
   return funcA();
}

Then I press hotkey for beautify-selection, the code becomes:
bool funcB()
{
   return ( funcA() ); //this is what I want
}

And I press that hotkey again, the code becomes:
bool funcB()
{
   return ( funcA(); //wrong code, lost a ')'
}


Language: C/C++

Beautify settings about this:
[Edits]-[Force/Removing Parenthesis]-[Parenthesis for 'return']: "Force If Complex Expression"
[Spacing]-[Statements]-[return]-[Before opening parenthesis]: checked, On
[Spacing]-[Statements]-[return]-[Pad inside parenthesis]: checked, On
« Last Edit: July 20, 2013, 10:46:02 AM by wangsitan »

wangsitan

  • Community Member
  • Posts: 15
  • Hero Points: 1
Re: SE18-Beautify bug on 'return' statement
« Reply #1 on: July 21, 2013, 05:10:26 AM »
code like this:
return ( a );

Then I press hotkey for beautify-selection, the code becomes:
return  a; //there are two space characters between 'return' and 'a'

And I press that hotkey again, the code becomes:
return a; //this is what I want


Language: C/C++

Beautify settings about this:
[Edits]-[Force/Removing Parenthesis]-[Parenthesis for 'return']: "Force If Complex Expression"
[Spacing]-[Statements]-[return]-[Before opening parenthesis]: checked, On
[Spacing]-[Statements]-[return]-[Pad inside parenthesis]: checked, On
[Spacing]-[General]-[Remove duplicate whitespace between words]: On

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: SE18-Beautify bug on 'return' statement
« Reply #2 on: July 22, 2013, 01:25:16 PM »
Reproduced it. It seems to have something to do with "Force if complex expression", it doesn't happen if it's set to Force.  I'll take a look at it.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: SE18-Beautify bug on 'return' statement
« Reply #3 on: July 23, 2013, 01:52:50 PM »
Fixes for both of these are in for v18.0.1.  (they're not hot-fixable).  Thanks for the reports on these.