12.x Cut/DeleteLine behavior changed?


I finally upgraded from 11 IU to 12.1.4 EAP IU 123.165,  and everything is fine except when I goto duplicate a line by moving cursor to the line and pressing Cut, Paste, Paste does not work like it did before.

Before, when I Cut, the line is cut, and the cursor is moved to column 1.   Then I can press Paste to restore the line, and Paste again to make a copy.   

Now in 12.x, when I cut the line, the cursor stays where it is, and so when I paste it back @ the cursor, making a mess. See example below.

I realize there is a keyboard command Duplicate Line which I could use instead, but I'm used to doing it this way.  I don't think you should change the behavior of basic editing commands.

I checked youtrack, and I found a possibly related issue where someone complained that deleting a line with Cut was repositioning the cursor to column 1,
and it is marked Fixed.

IDEA-86397 Delete line (Ctrl+Y) moves caret to the 1st column position

I believe it has always worked like this in IntelliJ, and was a feature not a regression,  and so this change should be reverted back.
If someone is used to it working differently in some other editor, then IntelliJ should provide an option to control the behavior so that all parties are happy.


For example,  if my caret (|) is on  line 2.
1 public static final int MINOR_ID = 2;
2 public static final | int MAJOR_ID = 3;
3 public static final int CRITICAL_ID = 4;

I press Cut and Paste Paste, I get the following in 12.x:

1 public static final int MINOR_ID = 2;
2 public static final     | public static final int MAJOR_ID = 3;
3  public static final int MAJOR_ID = 3;
4 int CRITICAL_ID = 4;

whereas before in 11.x I got:
1 public static final int MINOR_ID = 2;
2 public static final int MAJOR_ID = 3;
3 public static final int MAJOR_ID = 3;
4 |public static final int CRITICAL_ID = 4;


Created IDEA-100797 Cut/DeleteLine no longer moves the caret to column 1 after cutting line (when there is no selection)



Another example where I am getting tripped by changed behavior of Cut/DeleteLine when I want to move a line up or down.  

To move one line up/down in the file, I will quickly Cut/DeleteLine, move caret up/down a few lines, then Paste.

In 12.x, because Cut/DeleteLine is no longer moving the caret to column 1,  this workflow is broken.

I am trying to learn to use Move Statement Up (CTRL+SHIFT+UP) and Move Statement Down (CTRL+SHIFT+DOWN)  as a replacement, but when you've been using an IDE for 10 years, it's hard to unlearn basic editing commands.

Please revert Cut/DeleteLine back to the original behavior.



Please sign in to leave a comment.