Community
    • Login

    ALT+mouse selection change

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 4 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DotUniverse
      last edited by

      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:
      Current version

      Previous (expected):
      alt text

      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)

      wonkawillyW Alan KilbornA CoisesC 3 Replies Last reply Reply Quote 0
      • wonkawillyW
        wonkawilly @DotUniverse
        last edited by

        @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.

        1 Reply Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn @DotUniverse
          last edited by

          @DotUniverse

          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:

          8913389e-929f-4e1f-8c3f-6d4f5e86f8b3-image.png

          Execute a Copy

          Alt+click on line 1, some distance beyond the end of the line:

          a06378bf-08f4-48ec-9264-9dc58dabcfae-image.png

          Execute a Paste to get:

          2fad7ac2-8ed6-440e-a79b-2a2a5dc05541-image.png

          wonkawillyW 1 Reply Last reply Reply Quote 1
          • wonkawillyW
            wonkawilly @Alan Kilborn
            last edited by wonkawilly

            @Alan-Kilborn @DotUniverse

            @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.

            Alan KilbornA 1 Reply Last reply Reply Quote 0
            • Alan KilbornA
              Alan Kilborn @wonkawilly
              last edited by

              @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.

              1 Reply Last reply Reply Quote 1
              • CoisesC
                Coises @DotUniverse
                last edited by Coises

                @DotUniverse said in ALT+mouse selection change:

                Current:
                Current version

                Previous (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.

                1 Reply Last reply Reply Quote 2
                • CoisesC Coises referenced this topic on
                • CoisesC Coises referenced this topic on
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors