Rename action: preserve caret position


The new inline rename in Demetra is very nice.
It would be a great bonus if another age-old request was implemented as well:
preseving caret position when invoking an rename action:
http://www.jetbrains.net/jira/browse/IDEABKL-263
http://www.intellij.net/tracker/idea/viewSCR?publicId=4497

This would really combine the elegance of CamelHumps navigation with the
new inline variable name editing.


5 comments

Hello Taras,

Nice touch.

-


Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

The new inline rename in Demetra is very nice.
It would be a great bonus if another age-old request was implemented
as well:
preseving caret position when invoking an rename action:
http://www.jetbrains.net/jira/browse/IDEABKL-263
http://www.intellij.net/tracker/idea/viewSCR?publicId=4497
This would really combine the elegance of CamelHumps navigation with
the new inline variable name editing.



0

Hello Taras,

TT> The new inline rename in Demetra is very nice.

It is nice, indeed. I think it could be even nicer if:
- all the occurences to be changed would be shown (right now only the one
the refactoring is invoked from is marked with the red border). Highlighting
them as CtrlShiftF7 does would probably work, I guess.
- escape would cancel the action. Right now it has the same effect as pressing
enter or tab.

Best,
Andrei


0

The new inline rename in Demetra is very nice.


+1. I'm looking forward to the elimination of more modal dialogs in the future!

0

Thanks for the inline renaming.

Please fix the keyboard handling so that it behaves the same as the Rename Dialog. In particular,

1) Move Caret to Line Start and Move Caret to Line End

Observed: Goes to the beginning or end of the line.

If I enter rename mode on symbol someVar, then hit Move Caret to Line Start, the caret moves to "|Integer..." instead of "Integer |someVar..."

Expected: Goto the begining or end of the symbol being renamed, i.e. the boundaries of the inline rename box.

2) Enter

Observed: kills the selected symbol and inserts a newline
Expected: Should finish the rename operation. A newline shouldn't be inserted.

3) Navigation / Delete / Backspace

I was hoping that the inline rename box would behave as if it was still a dialog textfield, so that any navigation or editing would be limited to the bounds of the inline rename box. And the only way to get out of the special inline rename mode would be to hit ESC or ENTER.

Observed:
I noticed if I accidentally did one too many CTRL+BACKSPACEs, then the symbol I was renaming is deleted (ok), but the next word to the left is deleted and the inline rename mode is cancelled. I had to hit Undo repeately to recover. (Also there is a wierd quirk when you Undo. All the places where the symbol appeared, it now appears in duplicate, e.g. myVarmyVar instead of myVar.

Similarly, if I use the arrow keys, e.g. CTRL+LEFT_ARROW, I can move out of the inline rename box.

Expected: Editor Navigation and stuff like CTRLBACKSPACE, CTRLDELETE, Cut to End of Line, etc. should be bound by the inline rename box.


#1 and #2 are Critical for me, and probably for others that got used to the Rename Dialog.

0


All very good points, +1 on all of them.

In all seriousness, this will probably be the most-used refactoring (Even
more now that it's inline), so it deserves a significant amount of usability
attention.


0

Please sign in to leave a comment.