insanehunter / XCode4_beginning_of_line

Xcode plugin to make HOME key jump to the first non-whitespace line of code
168 stars 21 forks source link

algorithm improvements and unit tests #20

Closed dmatushkin closed 10 years ago

dmatushkin commented 10 years ago

Code looks more reliable now, but still has some known issues, like it does not see difference between brackets inside strings and operator brackets.

insanehunter commented 10 years ago

Great stuff, few bugs though:

NSCharacterSet * searchset = [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"%c%c", bracket, pair]];

Place a caret on NSCharacterSet, grow selection for entire line and then shrink it down. It won't shrink below the entire [] expression.

Also:

case '(':
        pair = ')';
        break;

Place caret inside pair, grow selection. It will occasionally jump away from pair.