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

added 2 actions based on Intellij Idea ones - to extend selection by pressing option+shift+up or to shrink it by pressing option+shift+down #19

Closed dmatushkin closed 10 years ago

insanehunter commented 10 years ago

Nicely done! Selection extension is very useful, though seems to grab adjacent whitespaces sometimes. Shrinking unfortunately loses initial entry position, e.g. you expand selection from the first word, then shrink it down and it ends on some other word. Nevertheless, it's a valuable addition. Thank you for contribution.

dmatushkin commented 10 years ago

Could you please send me the cases where it grabs adjacent whitespaces? Can not reproduce it.

insanehunter commented 10 years ago

Consider the following line:

... {
    return nil; // 4 spaces before return
}

If you set caret position right before first r in return and expand the selection, you'll end up with selection covering the whitespace. Or if you put caret somewhere inside the return word and expand twice, you'll come with <space>return nil selected (e.g. including a whitespace).