Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode auto-completion - replace text keystroke?

Say we have a TestClass with the 2 methods, -getSomeString and -getAnotherString, and we are editing the following code and the cursor is in the location shown:

NSString *aString = [TestClass get<cursorIsHere>SomeString];

Say I want to change it to use -getAnotherString. If I bring up the auto-completion popup and select the other method via hitting enter or tab, I'm left with:

NSString *aString = [TestClass getAnotherStringSomeString];

i.e., it doesn't replace the existing text but rather just inserts.

Is there a special keystroke to make it replace the remaining text?

See IntelliJ for reference.

like image 907
nevster Avatar asked Nov 29 '08 07:11

nevster


1 Answers

I don't think that there is a one step operation to achieve this. My suggestion would be similar to Thomas Templemann, but rather than two steps of forward word select and then Delete, I would expand to the desired autocomplete, by bouncing on Control + . and then hit Option + forward delete, which kills to the end of the word.

like image 109
cms Avatar answered Nov 16 '22 02:11

cms