ALT+mouse selection change
-
Hello,
I have recently install a new version of Notepadd++ and found out to unable to do ALT+mouse selection as it was before.
The problem is when I select multiple liens with ALT and than select to copy them side by side (so I can do things like ‘cp’ in bash). Instead of doing them with same indent as it was before now it paste right after one another:
Current:
Previous (expected):
Also, in my project I have every lines of different length.
Debug info:
Notepad++ v8.6.5 (64-bit)
Build time : Mar 29 2024 - 17:04:43
Path : C:\Programs\Office\Notepad++\notepad++.exe
Command Line :
Admin mode : ON
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Pro (64-bit
OS Version : 23H2
OS Build : 22631.3593
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4) -
@DotUniverse
Hi, try the following:
Column - select (Alt+left-click and mouse drag) or, in alternative, use Shift+Alt+[Left or Right or Up or Down] Arrow Keys on the computer keyboard, to select the text in column mode:
Items1
Items1
Items1
At this point you should have your column of text selected: when you’re satisfied with your column selection, hit Ctrl+d to duplicate the selected column at the right side of the existing selection.
Then to add a tab into the appropriate point to separate the first column from the second column you just added, do the following (You still have the first column selected):
press Right Arrow key on the keyboard (this will deselect the original column but will keep the caret on all lines in the right spot)
then
press Tab key on the keyboard to add a Tab and separate the first column form the second. -
I don’t think @wonkawilly 's response will satisfy you.
It seemed easy for me, here’s what I did:
Started with:
Item1 Item2 Item3 Item4 Item5 Item6
Held Alt while selecting with mouse:
Execute a Copy
Alt+click on line 1, some distance beyond the end of the line:
Execute a Paste to get:
-
@DotUniverse If you like to use the @Alan-Kilborn procedure that works pretty well too, first you need to go to Settings > Preferences > Editing 1 and check (if it is not) the checkbox for Enable virtual space: in fact if it checked the @Alan-Kilborn procedure will work great and will allow you to add even more distance (with space chars) all at once.
Such an option in fact basically is similar to enable editing in the point of the dblclick in MSWord: that adds newlines and space at any point in the page where the user double-clicks, with the difference that the one in N++ will only automatically add spaces to existing lines but will not create new lines.
Since N++ comes with that option checked and active by default, (as MSWord), if you have just installed N++ and not customized it, you are good to go. -
@wonkawilly said in ALT+mouse selection change:
first you need to go to Settings > Preferences > Editing 1 and check the checkbox for Enable virtual space
No, for the procedure I gave you do NOT need to do this first.
-
@DotUniverse said in ALT+mouse selection change:
Current:
Previous (expected):
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.
-
-