Andreas
Andreas

Reputation: 158

How do you deselect the text in a rename dialog without moving the cursor, with the keyboard, in IntelliJ IDEA

I'm using IntelliJ IDEA 10.5.2

Example:

code

Say I want to rename this class to SomeAwesomeClass. If we do the Rename refactoring we get a dialog like this:

rename dialog

It has the cursor in the right place however the text is selected. So if we started writing "Awesome" the original name would disappear. So what I want to do is keep the cursor position but deselect the text.

I have not been able to find any way to do this. All things I've tried ether moves the cursor or removes the text or does nothing.

The fact that the cursor is in the right place to start with makes me believe this is a existing feature...

Upvotes: 9

Views: 503

Answers (1)

osundblad
osundblad

Reputation: 2681

In 11-eap (110.365) when you rename a class (Shift+F6):

  1. at first full class name is selected and you have a dropdown with suggested names, press Esc
  2. full class name is still selected (dropdown gone), press Esc again
  3. you have class name unselected, and can write at cursor

Note a third Esc will exit rename.

In earlier versions (10.5.2) you can do a trick:

Before rename select one character (shift+arrow forward) where you want to end up (in SomeClass select C) then Shift+F6 and arrow back. I know it is a lot of keys to presses but in a long class name this helps.

Upvotes: 13

Related Questions