Community
    • Login

    Change of the selection mode

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 60 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.
    • guy038G
      guy038
      last edited by

      Hello, All,

      Here is a nice trick regarding selections :

      As an example, let’s use the list of the new features and bug fixes of the last v8.8.6 release, pasted in a new tab :

       1. Add capacity of pasting multiline into Find/Replace fields. (Fix #16952 )
       2. Improve UAC in Notepad++ for seamless elevated operations. (Fix #886 , #8655 , #9561 , #10302 , #14990 , #15008 , #15137 , #15323 )
       3. Fix Pin Tab operation being too long with many opened documents. (Fix #16117 )
       4. Add 2 new full-readonly modes via command line argument (-fullReadOnly & -fullReadOnlySavingForbidden). (Fix #15993 , #16532 )
       5. Add apply/remove read-only for all documents commands. (Fix #15993 , #16532 )
       6. Column Editor enhancement: GUI input fields now support radix to match the output format. (Fix #16912 )
       7. Add Window dialog “File Modified Time” sorting capacity. (Fix #16953 )
       8. Fix NPPN_CMDLINEPLUGINMSG not working issue & define the pluginMessage usage protocol. (Fix #17024 , #17022 )
       9. Fix pasting from column mode to multi-selection issue due to different EOL. (Fix #16889 )
      10. Add NPPM_GETNPPSETTINGSDIRPATH message to get Notepad++ settings directory path. (Fix #16944 )
      11. Enhance SQL function list parser. (Fix #16605 )
      12. Fix C# function list not working with comments. (Fix issue )
      13. Add function list ability for CSS. (Implement #17006 )
      14. Allow user to customize max selected chars to auto-fill “Find what” field. (Fix #16955 )
      15. Restore undo/redo behaviour in Find/Replace fields after Copy/Paste or Ctrl-F. (Fix issue 1 , issue 2 )
      16. Fix text corruption issue caused by selection within multibyte characters. (Fix #16879 )
      17. Fix DOCTYPE styling in xml and html. (Fix #17012 )
      18. Fix double clicking on edit zone’s border creates a new tab issue. (Fix issue )
      19. Update cURL in WinGUp (Notepad++ updater) for fixing CVE-2025-5399. (Fix security issue )
      
      • Open the search dialog ( Ctrl + F )

      • SEARCH ^(?-s)(.+\R)+

      • Select the Regular expression search mode

      • Check the Wrap around option

      • Click on the Find Next button

      => A stream selection of all the lines should occur !

      • Now, hit down, simultaneously, the Alt and Shift keys in order to begin a column mode selection

      • At the same time, hit the Up arrow once only

      => You should get a zero-length column mode selection of all the lines, at their beginning

      • Then, for instance, you may delete the numbering part ( the first three chars ) as this indication does not reflect any kind of order

      • And replace it by a bullet character by clicking, simultaneously, on the Alt and the 7 key of the Numpad keyboard


      This is a simple test to demonstrate that a stream selection can be transformed to a zero-length column mode selection !

      Best Regards,

      guy038

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

        @guy038 said in Change of the selection mode:

        Open the search dialog ( Ctrl + F )

        I just tried that. Then I tried doing just a Ctrl+A to select all the text more simply, and the Alt+Shift+UpArrow trick still worked to turn that stream into a zero-width column. That’s actually useful, as I often like getting a column at the beginning of the line. (It’s useful for going the other way – using the column editor to insert the line numbering.)

        But be warned: if the final line of the file doesn’t have a newline, then my method will end up selecting a rectangle from the end of the last line to the beginning of the first line:
        5380904c-9ee6-4c11-a985-d3ba42f4f6c9-image.png
        The regex version avoids that by making sure it only selects lines that end with a newline.

        This usually won’t be a problem for me, since I usually have a newline at the end of my file. I’ve just created a macro of the Ctrl+A then Alt+Shift+UpArrow sequence, and assigned a shortcut. It might just enter my standard workflow. So thanks, @guy038.

        Actually, I just found another difference. @guy038’s regex vesion will only select a “paragraph” worth, since it will stop at the first blank line. So if you have

        intro
        
         1. blah
         2. blah
        10. blah
        
        ending
        
        

        If your cursor is on intro or the line after, the regex will select the list. But if you’re on line 1. blah, then it will only select 2 and 10. And if you’re on the last line of the list, then it will actually select the ending paragraph.

        So it depends on what quirks you want, and whether you want “paragraph” or “whole document”, whether you should record the macro with my Ctrl+A or @guy038’s regex, or a slightly modified regex to match your most common use case(s). Since macros record searches, any of those could be made into a macro for a single-keystroke for what you want.

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