@DotUniverse said in ALT+mouse selection change:
Current:
Current versionPrevious (expected):
alt text
There was a change in behavior when pasting into a rectangular selection (including a zero-width selection) beginning with Notepad++ version 8.6.1.
I’m guessing that you made a rectangular selection of Item1-Item3 in the first column, copied, then made an empty selection three lines deep where you wanted to paste them, and pasted.
Previously, Notepad++ (using default Scintilla behavior) would have filled in the virtual space between the end of existing lines and the place where you indicated to paste. Notepad++ now treats the rectangular selection the same way as it would a multiple selection, and “collapses” the virtual space.
If the lines you paste are of different lengths (so that the rectangular selection before you copy includes virtual space), you’ll wind up with a zero-width “rectangular” selection in which the carets do not line up. Switching to another tab and back will leave you with a rectangular selection that seems barely related to anything.
See these GitHub issues:
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/15139
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/15151
for some of the oddities encountered.
The solution for users, for now, is that if you want the familiar behavior when pasting rectangular selections, do not paste into a rectangular selection; instead, just click at the top of the column where you want to paste. This operation still works the same as it always did, which is to insert the copied selection line by line into the document at the same column as the cursor.
Pre-8.6.1, all pasting a copied rectangular selection into a rectangular selection did was to delete the contents of the rectangular selection, then paste as if there were an empty selection (i.e., just a caret) at the top of the deleted section. It did not matter how deep the selection was; it just deleted it and then inserted the new text (which could be fewer, the same or more lines than the deleted selection). The new behavior has so many oddities — if you are used to rectangular selections — that it’s easiest just to do the delete and reposition the cursor if you need to, then paste.