Author Topic: B3: "if" space before opening parenthesis not respected  (Read 1081 times)

rowbearto

  • Senior Community Member
  • Posts: 1543
  • Hero Points: 113
B3: "if" space before opening parenthesis not respected
« on: September 11, 2017, 02:20:28 pm »
I uploaded my configuration and source file to support.slickedit.com under "ifbrace.tar.gz". My configuration and source file are needed to reproduce.

In my C++ formatting, I have the "space before opening parenthesis" set to "On":

Tools->Options->Languages->Application Languages->C/C++->Formatting->Edit->Spacing->Statements->If->Before opening parenthesis->On

See attached picture: space_before_opening_paren.png

In my source file "ifbrace.cc" go to the end of line 78, type <ENTER> and then "if<space>".

After typing the <space> can see that there is no space between the "if" and opening parenthesis, see: "space_before_opening_paren_not_respected.png"


patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1165
  • Hero Points: 110
Re: B3: "if" space before opening parenthesis not respected
« Reply #1 on: September 11, 2017, 02:51:47 pm »
Taking a look at it, thanks for the report.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1165
  • Hero Points: 110
Re: B3: "if" space before opening parenthesis not respected
« Reply #2 on: September 11, 2017, 02:59:28 pm »
You have adaptive formatting turned on, and it decided from previous source in the file that there was no space before parenthesis.  You can run the adaptive-format-stats command to get a summary of what adaptive formatting has decided for a particular file.

rowbearto

  • Senior Community Member
  • Posts: 1543
  • Hero Points: 113
Re: B3: "if" space before opening parenthesis not respected
« Reply #3 on: September 11, 2017, 03:35:39 pm »
I was able to keep adaptive formatting on, but turn off "no space before parenthesis", so that I can get the space before parenthesis in this case.

Thanks again!
Rob

joecar

  • Senior Community Member
  • Posts: 251
  • Hero Points: 9
  • engineer/gearhead
Re: B3: "if" space before opening parenthesis not respected
« Reply #4 on: September 11, 2017, 04:27:46 pm »
I was able to keep adaptive formatting on, but turn off "no space before parenthesis", so that I can get the space before parenthesis in this case.

Thanks again!
Rob
How did you do this...?

rowbearto

  • Senior Community Member
  • Posts: 1543
  • Hero Points: 113
Re: B3: "if" space before opening parenthesis not respected
« Reply #5 on: September 11, 2017, 04:32:17 pm »
Tools->Options->Languages->Application Languages->C/C++->Adaptive Formatting

The checkbox is located in this screen.