Xcode 7.2: Paste and Preserve Formatting should be the default behaviour of ⌘V
| Originator: | aralbalkan | ||
| Number: | rdar://24123171 | Date Originated: | 10-Jan-2016 04:39 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 7.2 (7C68) |
| Classification: | UI/Usability | Reproducible: | Always |
Summary:
Paste (⌘V) destroys the formatting of code where braces are on their own lines. (I use this style because I can quickly scan my code to for indentation-related issues and missing braces by mentally drawing lines between opening and closing braces in my code.)
Steps to Reproduce:
1. Write the following function:
func forwardTo(callback:() -> Void)
{
callback()
}
forwardTo()
{
print("Hello");
}
2. Copy it
3. Paste it with ⌘V
4. Paste is with ⌘⌥⇧V
Expected Results:
Both should result in:
func forwardTo(callback:() -> Void)
{
callback()
}
forwardTo()
{
print("Hello");
}
Actual Results:
#3 results in broken formatting:
func forwardTo(callback:() -> Void)
{
callback()
}
forwardTo()
{
print("Hello");
}
#4 works (thanks Joe, for the heads-up on Twitter) :)
Notes:
I would expect ⌘V to behave like Paste and Preserve Formatting when I’ve copied from Xcode and I’m pasting into Xcode. The current behaviour is a bug. If anything, the option to paste and run some magic on it should be the more convoluted shortcut :)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!