Option-arrow navigation doesn't work well with string literals

Originator:bjhomer
Number:rdar://13402410 Date Originated:12-Mar-2013
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 4.6
Classification:UI/Usability Reproducible:Always
 
Summary:
Option-left and Option-right are generally used to navigate a word at a time. In source code, it's not always clear what a "word" means. I would argue that Xcode  should consider tokens as words, though traditional words inside string literals should count too. Additionally, option-navigation should never cross line breaks unless the cursor is already at the line boundary

As things currently stand, Xcode seems to simply ignore all punctuation and whitespace, and move the cursor to the beginning/end of the nearest word boundary. This doesn't generally do what I want.

Thus, in this line:
   NSString *str = @"This is a string";

If the cursor is at the end of the line, I would expect option-left to sequentially move the cursor to the positions marked by | here, which indicate the left edge of a given token:
|   |NSString |*|str |= |@"|This |is |a |string|"|;

If the cursor is at the beginning of the line, I would expect option-right to sequentially move the cursor to these positions:
   NSString| *|str| =| @"|This| is| a| string|"|;|


I've attached a video of the problem in action; using option-navigation, it's impossible to highlight an entire string literal.

12-Mar-2013 12:36 PM BJ Homer:
'Option-navigation.mov' was successfully uploaded

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!