Community
    • Login

    npp v8.6 reverses the order of lines on column copy/paste

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    25 Posts 7 Posters 7.2k 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.
    • astewart77A
      astewart77 @Coises
      last edited by

      @Coises said in npp v8.6 reverses the order of lines on column copy/paste:

      I’m thinking, at least, since rectangular selections are always treated as top-down regardless of how they are made, if they must convert to empty multiple selections on arrow keys, at least the multiple selection should be top-down, regardless of how the rectangular selection was made. But I suspect those who use multiple selections more than rectangular selections will disagree.

      As a multi-edit user, I rarely move a bunch of carets together with up or down arrows. Odd things happen at the end of lines/file. The appearance of vertically aligned carets as a unit is misleading. Better to create a new zero-width selection at the target location.

      I have a hotkey to rotate the main selection through a set of multi-edit carets for review and I see that it also rotates line by line through a rectangular selection, with order depending on selection direction. So it seems that Scintilla simply converts a rectangular selection “line-by-line” to multi-edit carets, in the same order. The main selection is the “last” caret . In the OP, the main caret was the top most after the upward copy and still top most after the down arrows.

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

        @astewart77 said in npp v8.6 reverses the order of lines on column copy/paste:

        After Ctrl-V I have

        abcd
        efgh
        ijkl

        ijkl
        efgh
        abcd

        And doing the same thing, I got:

        abcd
        efgh
        ijkl
        
        abcd
        efgh
        ijkl
        

        I removed all plugins, just in case that was the cause. Debug info:

        Notepad++ v8.6   (64-bit)
        Build time : Nov 23 2023 - 16:58:44
        Path : C:\Program Files\Notepad++\notepad++.exe
        Command Line : 
        Admin mode : OFF
        Local Conf mode : OFF
        Cloud Config : OFF
        OS Name : Windows 10 Pro (64-bit)
        OS Version : 22H2
        OS Build : 19045.3693
        Current ANSI codepage : 1252
        Plugins : none
        

        I don’t have a guess as to why your results are different.

        As far as thin selections, from the same starting set, I copy the first block, upward rectangular select the first letter of the second block and type x in to it.

        If I do that and paste, I get:

        abcd
        efgh
        ijkl
        
        xabcdwer
        xefghyui
        xijklpkl
        

        If, instead of typing an x, I press the right arrow key, then I get:

        abcd
        efgh
        ijkl
        
        qijklwer
        tefghyui
        oabcdpkl
        

        The right arrow converts to an empty multiple stream selection — that’s intentional new behavior in 8.6 — and then the selection direction matters, because it preserves the selection order that was used to make the rectangular selection.

        astewart77A 1 Reply Last reply Reply Quote 0
        • astewart77A
          astewart77 @Coises
          last edited by

          @Coises said in npp v8.6 reverses the order of lines on column copy/paste:

          I removed all plugins, just in case that was the cause. Debug info:

          Notepad++ v8.6   (64-bit)
          Build time : Nov 23 2023 - 16:58:44
          Path : C:\Program Files\Notepad++\notepad++.exe
          Command Line : 
          Admin mode : OFF
          Local Conf mode : OFF
          Cloud Config : OFF
          OS Name : Windows 10 Pro (64-bit)
          OS Version : 22H2
          OS Build : 19045.3693
          Current ANSI codepage : 1252
          Plugins : none
          

          I don’t have a guess as to why your results are different.

          OK. I tried a portable minimalist n++ and I see what you see.

          My usual plugin load is:

          Notepad++ v8.6   (32-bit)
          Build time : Nov 29 2023 - 22:23:02
          Path : C:\Program Files (x86)\Notepad++\notepad++.exe
          Command Line : 
          Admin mode : ON
          Local Conf mode : OFF
          Cloud Config : OFF
          OS Name : Windows 7 Home Premium (64-bit)
          OS Build : 7601.0
          Current ANSI codepage : 1252
          Plugins : 
              AnalysePlugin (1.14.54)
              ColumnsPlusPlus (1)
              DSpellCheck (1.5)
              ExtSettings (1.3.1)
              GotoLineCol (2.4.3)
              HTMLTag_unicode (1.4.1)
              JSMinNPP (1.2308)
              MarkdownViewerPlusPlus (0.8.2)
              mimeTools (2.9)
              NppConverter (4.5)
              NppEventExec (0.9)
              NppExec (0.8.7)
              NppExport (0.4)
              NppMenuSearch (0.9.6)
              NppToolBucket (1.10.6622.41336)
              NppUISpy (1.2)
              RandomValuesNppPlugin (0.2.1)
              SurroundSelection (1.4.1)
              _CustomizeToolbar (5.3)
          
          

          I’ll narrow it down, but I kinda like it the way it is.

          astewart77A 1 Reply Last reply Reply Quote 1
          • astewart77A
            astewart77 @astewart77
            last edited by

            @astewart77 said in npp v8.6 reverses the order of lines on column copy/paste:

            @Coises said in npp v8.6 reverses the order of lines on column copy/paste:

            I don’t have a guess as to why your results are different.

            OK. I tried a portable minimalist n++ and I see what you see.

            Well, not a plugin or a setting! The portable minimalist I used is an 8.6 release. I forgot that I updated my main n++ to a master on github from two weeks ago, entitled
            Fix visual glichy on multi-paste and make shortcut commands more coherent

            After I copied the .exe from that master to my portable dir, no plugins, default settings, the portable behaved as I have been seeing. The master still says 8.6 in the windows file properties, but the ordering of rectangular pasting is different from the 8.6 release.

            Whether this is an upcoming 8.6.1 bug or a feature is probably a personal pref.

            astewart77A CoisesC 2 Replies Last reply Reply Quote 0
            • astewart77A
              astewart77 @astewart77
              last edited by

              @astewart77 said in npp v8.6 reverses the order of lines on column copy/paste:

              @astewart77 said in npp v8.6 reverses the order of lines on column copy/paste:
              I updated my main n++ to a master on github from two weeks ago, entitled
              Fix visual glichy on multi-paste and make shortcut commands more coherent

              After I copied the .exe from that master to my portable dir, no plugins, default settings, the portable behaved as I have been seeing. The master still says 8.6 in the windows file properties, but the ordering of rectangular pasting is different from the 8.6 release.

              More difference - with 8.6, after the paste there a single caret top left. With the change in the master commit, after the paste, there are zero width multi-carets on the right and status bar shows Sel : 3x0. A bug that was mentioned elsewhere - if you switch to another tab and back, the carets are on the left, full rectangular selection, status is Sel : 3x4.

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

                @astewart77 said in npp v8.6 reverses the order of lines on column copy/paste:

                More difference - with 8.6, after the paste there a single caret top left. With the change in the master commit, after the paste, there are zero width multi-carets on the right and status bar shows Sel : 3x0. A bug that was mentioned elsewhere - if you switch to another tab and back, the carets are on the left, full rectangular selection, status is Sel : 3x4.

                Ugh. This sounds like paste into rectangular selection is, in the updated build, being treated as paste into multiple selection.

                I haven’t (yet) managed to identify what changed to cause this, but I’d guess that either Notepad++ is processing paste differently, or it took over from letting Scintilla process it natively and isn’t duplicating Scintilla’s process accurately.

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

                  @astewart77 said in npp v8.6 reverses the order of lines on column copy/paste:

                  After I copied the .exe from that master to my portable dir, no plugins, default settings, the portable behaved as I have been seeing. The master still says 8.6 in the windows file properties, but the ordering of rectangular pasting is different from the 8.6 release.

                  I found out what happened.

                  In 8.6, your test does not show reversal. However, still in 8.6, if you do the same test except for using the Edit | Paste menu command instead of Ctrl+v, the text is pasted in reverse order.

                  In 8.6, Ctrl+v was associated with the Scintilla command SCI_PASTE. The menu command, however, is processed directly by Notepad++.

                  In the current master, Ctrl+x/c/v are mapped to the menu commands instead of the Scintilla commands. Menu cut and copy, as far as I can tell, do not behave differently than Scintilla cut and copy for rectangular selections in 8.6; it’s just menu paste.

                  The change happens in #0978b2e.

                  astewart77A 1 Reply Last reply Reply Quote 2
                  • astewart77A
                    astewart77 @Coises
                    last edited by

                    @Coises said in npp v8.6 reverses the order of lines on column copy/paste:

                    In the current master, Ctrl+x/c/v are mapped to the menu commands instead of the Scintilla commands.

                    So it’s a feature if you like having keyboard access to the menu paste method, but a bug if you don’t, because SCI_PASTE is no longer available for remapping back to Ctrl+v.

                    mkupperM 1 Reply Last reply Reply Quote 0
                    • mkupperM
                      mkupper @astewart77
                      last edited by

                      @astewart77 said in npp v8.6 reverses the order of lines on column copy/paste:

                      So it’s a feature if you like having keyboard access to the menu paste method, but a bug if you don’t, because SCI_PASTE is no longer available for remapping back to Ctrl+v.

                      Removing SCI_COPY, SCI_PASTE, etc. seems like it would create problems for people who already have macros that use those SCI codes. For example, this person’s macro uses 2178 which is SCI_COPY though in his case it’s also followed by 42002 IDM_EDIT_COPY

                      astewart77A 1 Reply Last reply Reply Quote 2
                      • astewart77A
                        astewart77 @mkupper
                        last edited by

                        @mkupper said in npp v8.6 reverses the order of lines on column copy/paste:

                        @astewart77 said in npp v8.6 reverses the order of lines on column copy/paste:

                        So it’s a feature if you like having keyboard access to the menu paste method, but a bug if you don’t, because SCI_PASTE is no longer available for remapping back to Ctrl+v.

                        Removing SCI_COPY, SCI_PASTE, etc. seems like it would create problems for people who already have macros that use those SCI codes.

                        SCI_PASTE still exists. I meant it’s just no longer listed in the Shortcut Mapper for easy remapping. I made an NppExec macro with SCI_PASTE and mapped that to Ctrl+v. That works.

                        1 Reply Last reply Reply Quote 1
                        • Theo PavloudisT
                          Theo Pavloudis
                          last edited by

                          Is this going to get fixed now?
                          I am facing the same issue with 8.6.
                          It’s really annoying…
                          No plugins at all.

                          Alan KilbornA mkupperM 2 Replies Last reply Reply Quote 0
                          • Alan KilbornA
                            Alan Kilborn @Theo Pavloudis
                            last edited by

                            @Theo-Pavloudis said in npp v8.6 reverses the order of lines on column copy/paste:

                            Is this going to get fixed now?
                            I am facing the same issue with 8.6.
                            It’s really annoying…

                            It sure seems like you should try the latest version as of this writing (8.6.4).

                            Theo PavloudisT 1 Reply Last reply Reply Quote 2
                            • mkupperM
                              mkupper @Theo Pavloudis
                              last edited by

                              @Theo-Pavloudis said in npp v8.6 reverses the order of lines on column copy/paste:

                              Is this going to get fixed now?
                              I am facing the same issue with 8.6.
                              It’s really annoying…
                              No plugins at all.

                              It is fixed in v8.6.4 but you need to disable Column Selection to Multi-Editing in the Preferences / Editing 2 tab. This setting, and the Enable Multi-Editing one in the same Preferences section were added as part of v8.6 and enabled by default. To restore the classic “normal” Notepad++ behavior people need to disable both settings. You only need to disable the Column Selection to Multi-Editing part if you are only interested in the order-of-lines issue reported in this forum thread.

                              npp-disable-multi-editing.png

                              1 Reply Last reply Reply Quote 2
                              • Theo PavloudisT
                                Theo Pavloudis @Alan Kilborn
                                last edited by Theo Pavloudis

                                @Alan-Kilborn @mkupper it’s still there in 8.6.8 either with Column Selection to Multi-Editing on or off.

                                First image is the original, second image is what happens when I paste it.
                                The order is reversed…

                                original.PNG
                                pasted.PNG

                                CoisesC 1 Reply Last reply Reply Quote 0
                                • CoisesC
                                  Coises @Theo Pavloudis
                                  last edited by

                                  @Theo-Pavloudis said in npp v8.6 reverses the order of lines on column copy/paste:

                                  @Alan-Kilborn @mkupper it’s still there in 8.6.8 either with Column Selection to Multi-Editing on or off.

                                  This was fixed in 8.6.9 (item 13 in the announcement).

                                  1 Reply Last reply Reply Quote 3
                                  • notdodgeballN
                                    notdodgeball
                                    last edited by

                                    Animation.gif

                                    I am having the same problem. I tried with versions v8.8.3 and v8.7.7, can somebody else reproduce this?

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

                                      @notdodgeball said in npp v8.6 reverses the order of lines on column copy/paste:

                                      I am having the same problem. I tried with versions v8.8.3 and v8.7.7, can somebody else reproduce this?

                                      Yes. However, it is not a bug, but a “feature.”

                                      Column selections are expected to retain their physical order regardless of the direction in which they were selected. That’s what the earlier part of this thread concerned.

                                      You made a zero-width column selection, but then (I think) you pressed Shift+End. That converted the column selection to a multiple selection. You can see that because the carets at the end of each line are not lined up. A column selection would be a rectangle that included the empty space at the end of shorter lines and had all the flashing carets lined up.

                                      Multiple selections regard the order in which the selections were made. Even though you started as a column selection, the fact that you started at the bottom and extended to the top is “remembered” when you change it to a multiple selection. So the bottom line is “first,” and that’s how it’s pasted.

                                      If you wanted to extend your zero-width column selection to the right, you would have had to use Alt+Shift+right arrow until you got it as wide as desired (or just make the original selection by doing a click at one corner and an Alt+Shift+click at the diagonally opposite corner).

                                      PeterJonesP 1 Reply Last reply Reply Quote 1
                                      • PeterJonesP
                                        PeterJones @Coises
                                        last edited by

                                        @notdodgeball ,

                                        Further to what @Coises said (regarding “(I think) you pressed Shift+End. That converted the column selection to a multiple selection”), turning off the Settings > Preferences > Editing 2 > ☐ Enable Column Selection to Multi-Editing would have prevented that switch from Column mode to Multi-Edit mode. That would have made it more obvious.

                                        Even with that option enabled, there are ways to fix it:

                                        1. Like @Coises said, use Alt+Shift+RightArrow to extend to the right
                                        2. You could also use Alt+Shift+End instead of Shift+End, which would extend the selection to the end of the active line’s width, but keep it a column (rectangle); you could then use Alt+Shift+RightArrow to finish extending it if the active line wasn’t the widest line.

                                        Here’s a screen recording of me using the keyboard (even for the initial column selection) to do all that. Hopefully, you can follow along with my notes in the recording to understand it. (Recorded in v8.7.7, because I had gone back there to verify the option existed in the older version you listed.)

                                        31ed167f-942d-484b-a4f9-5605d9df3e55-ColumnToMulti.gif

                                        Unlike @Coises , I don’t consider it a “feature” (ie, a bug masquerading as a feature), I think it’s a reasonable compromise between all the different opinions on what the “right” behavior should be when mixing between column and multi-select mode.

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

                                          @PeterJones said in npp v8.6 reverses the order of lines on column copy/paste:

                                          Unlike @Coises , I don’t consider it a “feature” (ie, a bug masquerading as a feature), I think it’s a reasonable compromise between all the different opinions on what the “right” behavior should be when mixing between column and multi-select mode.

                                          I agree — perhaps the scare quotes were a bit excessive. For certain, it’s intended behavior; it was never a bug that was presented as a feature to avoid dealing with it.

                                          I think that for users like me, who use rectangular selections frequently and multiple selections rarely, the improvements to multiple selection in the early 8.x releases felt like a degradation in user experience. Some of that has been mitigated by the Multi-Editing options (though, for example, turning off the ability to create multiple selections when you do want them is an unfortunate trade-off for not breaking normal drag-copy conventions… but if I recall correctly, that binary choice is baked into Scintilla, so it would be fragile at best for Notepad++ to attempt something different).

                                          I imagine it appears exactly reversed to people who use multiple selections often and rarely want rectangular selections: they probably wish the distinction could be eliminated so they didn’t have to keep track of different behaviors when a rectangular selection hasn’t been changed to a multiple selection.

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