Parentheses added around highlighted statement add new lines

Lately I've noticed that adding parentheses around a highlighted statement puts them on new lines above and below the statement.

Expected

(greeting)

Actual

(
    greeting
)

I can't attribute the change in behavior to a specific version but I'm currently on 14.2 (14C18).

Is this a preference or is something else going on?

Accepted Reply

This is apparently a bug in Xcode 14. It happens when you select entire lines (with or without the final end-of-line delimiter).

Please file a bug report against Xcode: https://developer.apple.com/bug-reporting/

  • Filed under FB11992897

Add a Comment

Replies

That's defined in Preferences "Enclose selection in matching delimiters:

  • deselect the option, and typing ( will replace selection by (.
  • select the option and you get the behaviour you described.
  • same behaviour with any delimiter like curly brace { or quotes
  • but the line insertion is specific to some delimiters as (, {
  • Thank you Claude. I swear this use to work as I expected though. Is there no way to get (greeting)?

Add a Comment

This is apparently a bug in Xcode 14. It happens when you select entire lines (with or without the final end-of-line delimiter).

Please file a bug report against Xcode: https://developer.apple.com/bug-reporting/

  • Filed under FB11992897

Add a Comment