Author Topic: Can't turn off "Insert Padding between parenthesis" behavior  (Read 3248 times)

Marc Paradise

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Hi,

I'm hoping that there's an obvious solution to this problem that I've missed.

I'm working with a custom language that is very much C-like, so I associated the file extension (.nss) with C/C++.   I decided to try the "insert padding" option out, and enabled it for C/C++.  I decided that I didn't like it, and turned it back off.  This is correctly reflected in the options UI.

This works as expected in actual C/C++ files -- the auto-padding is disabled.   Unfortunately, in the custom file extension, it remains enabled.

Has anyone else encountered this? Any suggestions?

SE Version:  14.0.2.1

Thanks,

Marc

Marc Paradise

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Can't turn off "Insert Padding between parenthesis" behavior
« Reply #1 on: August 03, 2009, 01:35:00 am »
Revised information: I was mistaken earlier.  Even plain C/C++ files exhibit the same behavior: even though the 'insert padding between parenthesis' behavior has been turned off, it still inserts padding.  This isn't specific to the custom C-like language extension as I first thought.

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Can't turn off "Insert Padding between parenthesis" behavior
« Reply #2 on: August 03, 2009, 02:47:14 pm »
Hi Marc,

In my testing, the functionality to insert padding between parentheses is working just fine.

I go to Document > C/C++ Options > Formatting, select the Indentation tab, and put a check in "Insert padding between parentheses.
In the editor window, if I type "if " (if followed by a space), syntax expansion inserts the rest of the if statement and the parens are padded with spaces: "if ( | ) ...", where the | represents the cursor.

If I go back and uncheck that checkbox and then type another if, I get "if (|) ..."

Can you tell us specifically what you are typing? One possible issue is Adaptive Formatting. It analyzes your files and offers to override your settings so that the code you type matches the existing style used in the file. You should turn that feature off while trying to work through this issue to make sure it's not confusing things. On the Indentation tab, you'll see a blue link that says "(Adaptive On)". Click that and uncheck "Use Adaptive Formatting". You can turn it back on if you like once we've gotten this resolved.

Marc Paradise

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Can't turn off "Insert Padding between parenthesis" behavior
« Reply #3 on: August 03, 2009, 04:24:51 pm »
Thanks for the reply Scott.

I had been configuring this through Options -> Languages -> App Languages -> C/C+ -> Formatting, checkbox "Insert padding between parenthesis."   It looks like this is the same location; adaptive formatting is turned off.

It looks like padding between control blocks (if/while/etc) is not exhibiting this - it seems specific to function calls.  So as best as I can show:

Type: strcpy(
Cursor jumps to here: strcpy( *
Type: x,
Cursor jumps to here: strcpy( x, *
Type: y
Cursor is here: strcpy( x, y*
Type: )
Placement is here: strcpy( x, y )*


This happens for any valid function -- macros and nonexistent functions do not trigger the automatic space insertion.

Below I've linked to a screenshot  "replay" taken in Win7's "Problem Step Recorder" -- it should be openable in IE 7 and 8. I could not attach it directly, because it is too big (about 4MB).

http://dev.khalidine.com/troubleshooting/Issue2.zip

Thanks again for your help.


« Last Edit: August 03, 2009, 04:42:53 pm by Marc Paradise »

microcode

  • Community Member
  • Posts: 59
  • Hero Points: 9
Re: Can't turn off "Insert Padding between parenthesis" behavior
« Reply #4 on: August 05, 2009, 04:34:01 pm »
There are some other options which I think affect the editing of function parameters. Go to the C/C++ -> Context Tagging options page. On there is a section labeled "Parameter Information" with several options. Two in particular are "Pad parentheses" and "Insert space after comma".  Try changing those options to see if it changes the behavior you're seeing.

Marc Paradise

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Can't turn off "Insert Padding between parenthesis" behavior
« Reply #5 on: August 05, 2009, 05:11:47 pm »
Ah, excellent! That was exactly it, thanks for the information :)

Strange that it's associated separately with context tagging, is it seems to be a formatting concern.  Nonetheless, I apparently searched options for "padding" and not "space", else it would have turned up.

Thanks again.