Unusual formatting problem using if statements.

In my configuration file I have disabled spaces between an if statement and its opening bracket. That works ok each time I manually edit and add another if statement. However, if I copy-and-paste an existing if statement (no space) and paste it into the code, RS adds a space between the if keyword and the opening bracket.

It's not a problem to remove the space but I'm puzzled why it's being added when my configuration file seemingly tells RS not to add them. Is there another setting somewhere I've overlooked?

2 comments
Comment actions Permalink

VS 2008's native code formatting kicking in during paste, perhaps? I'm not sure if R# entirely takes over the formatting, but in lieu of a more authoritative reply you might want to check the VS formatting settings to see if changing them makes a difference in specific scenarios, e.g. yours.

0
Comment actions Permalink

Well spotted, Jeremy. That was indeed the case or at least it seems to be the case. My VS settings had the insert space after keywords enabled. Once I unchecked it the copy-and-paste occurs without the space being automatically inserted. It looks like there is a tug-of-war going on between VS and RS. ;)

0

Please sign in to leave a comment.