Delete stops working with multi-caret

It's difficult to determine the precise circumstances that cause this, but the example I have is as follows.

Have auto properties that are assigned values:

public int X { get; } = 5;
public int Y { get; } = 5;

Use multi-caret to select some part of the assignment portion, with the carets at the end of the line. (Hard to convey, but for example, select 5; on both lines:

public int X { get; } = |5;|
public int Y { get; } = |5;|

Result: cannot delete the selected text with the delete key, however the backspace key does work.

It seems to be important that the selection extends from any part of the line to the end of the line. If it does not go to the end of the line, delete still works. If you start from the end and select to the middle of the line, delete still works.

With further testing I think I can see that this happens with any lines of code as long as you are using multicaret and select to the end of the line. My example of auto-properties is not important.

Thanks

0
3 comments

Hi Dave! 

Thank you for the detailed description. However, I can't reproduce the issue so far. What is your OS and Rider version? Also, which keymap do you use? Do you select the code to the end of the line with arrows or with End button? 

Thanks! 

0

Windows 10 22H2

Rider 2023.2.2 (has happened for a while but not sure since exactly when)

Keymap: Visual Studio with custom changes

Selecting with End or with arrows still has the same issue.

I notice that if the lines are of different length, and lets say you select between the | symbols using multi-caret:

This().Line().Is().Lon|ger().Than().The()|.Other().Line();
This().Line().Is().Sho|rter();           |

Then Delete will work on the line with the caret still before the end of the line, but it won't work on the line where the end of the line is selected. Pressing Delete would result in the following, with the shorter line still selected:

This().Line().Is().Lon|.Other().Line();
This().Line().Is().Sho|rter();           |

For the keys, my key presses would be:

  • Alt+Shift+Up (create second caret)
  • Hold Shift + Right Arrow (select to end of line or past end of line)
  • Delete by itself (should delete but does nothing; Backspace works)
0

Hi Dave! 

Thank you for the details. 

I was able to reproduce the issue. It seems to relate to Clone Caret Above with Virtual Space action. It is bundled to Alt+Shift+Up shortcut in the VS keymap. As a workaround, I can suggest remapping the shortcut to a regular Editor Actions | Clone Caret Above in File | Settings | Keymap

I also reported the issue to our tracker; feel free to follow and upvote. 

I hope this helps! I'll also do my best to reproduce other issues with multi caret you've described. 

0

Please sign in to leave a comment.