So this has been driving me crazy for a while now: when you have a lot of blank space before a word, you go to the beginning of the line and push option-delete, it will delete not only the blank space, but also the next word. All editors in Windows and Linux will only delete the blank space. Is there a setting for this? This is an absolute must-have for me when, for example, trying to format code in XCode. As an example:

This is line 1 (caret->) |             this should not get deleted

Pushing option-delete, I expect this:

This is line 1 (caret->) |this should not get deleted

But instead, I get this:

This is line 1 (caret->) |should not get deleted

This is particularly nasty when you copy-paste code from somewhere, and get something like this:

UIImageView *imgView = [[UIImageView alloc] initWithFrame:

....and you want to quickly consolidate into one line. Does anyone have a fix for this?

  • I think this behaviour is by design. I've just learned to work around it. – user479 May 18 '11 at 3:31
  • So how do you work around it? – Mirkules May 18 '11 at 4:19

I select the entire space and word as per your example. Then keeping Shift and Option pressed, I use the left arrow to select the empty space. Works like a charm and is only one extra keypress.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .