• Login
Community
  • Login

Multi-cursor editing

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
53 Posts 8 Posters 10.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.
  • A
    astrosofista @Alan Kilborn
    last edited by Apr 5, 2020, 3:57 AM

    @Alan-Kilborn

    Definitively regex, or at least some of its functions are invoked in the original PS. I typed an \s at the end of the first paragraph —I mean the GNU License sample text—, then selected the backslash, run the script, then the s and the script… PS ignored single characters and only take into consideration whole words, so when I selected the first T, PS did nothing, but This was selected and PS correctly matched the other two instances of the word.

    Anyway, the script modification you provided solved the issue. A big thanks for your assistance and fast reply.

    Best Regards.

    1 Reply Last reply Reply Quote 2
    • E
      Ekopalypse
      last edited by Apr 5, 2020, 9:45 AM

      @astrosofista @Alan-Kilborn

      Thanks for testing and improving.
      I haven’t noticed it yet but it makes sense.
      The documentation for searchFlags is described here.

      A A 2 Replies Last reply Apr 5, 2020, 12:01 PM Reply Quote 2
      • A
        Alan Kilborn @Ekopalypse
        last edited by Apr 5, 2020, 12:01 PM

        @Ekopalypse said in Multi-cursor editing:

        The documentation for searchFlags is described here.

        Yes but that documentation falls flat when you need an actual number to pass to a function!

        Is there some Python magic one can do to find these identifiers? What I mean is, if I do dir(MENUCOMMAND) in the P.S. console, I see:

        >>> dir(MENUCOMMAND)
        ['CLEAN_RECENT_FILE_LIST', 'EDIT_AUTOCOMPLETE', 'EDIT_AUTOCOMPLETE_CURRENTFILE', 'EDIT_AUTOCOMPLETE_PATH', 'EDIT_BEGINENDSELECT', ...
        

        Some similar way of finding these “SCFIND_” things?

        E 1 Reply Last reply Apr 5, 2020, 12:23 PM Reply Quote 0
        • E
          Ekopalypse @Alan Kilborn
          last edited by Apr 5, 2020, 12:23 PM

          @Alan-Kilborn

          for readability you normally use FINDOPTION.NONE instead of the 0.
          In order to get all values from such enum you can call its values method.
          For example: FINDOPTION.values() would return

          {0: Npp.FINDOPTION.NONE, 1048576: Npp.FINDOPTION.WORDSTART, 2: Npp.FINDOPTION.WHOLEWORD, 4: Npp.FINDOPTION.MATCHCASE, 2097152: Npp.FINDOPTION.REGEXP, 8388608: Npp.FINDOPTION.CXX11REGEX, 4194304: Npp.FINDOPTION.POSIX}
          
          
          A 2 Replies Last reply Apr 5, 2020, 12:37 PM Reply Quote 2
          • A
            Alan Kilborn @Ekopalypse
            last edited by Alan Kilborn Apr 5, 2020, 12:38 PM Apr 5, 2020, 12:37 PM

            @Ekopalypse said in Multi-cursor editing:

            for readability you normally use FINDOPTION.NONE instead of the 0.

            Yes, but you have to know that EXISTS first! :-)

            To your point about “readability”…that’s why I was asking.
            I would much rather NOT use the magic number of zero.

            I didn’t see anything that logically links FINDOPTION to the SCFIND nomenclature. Maybe I missed the connection.

            1 Reply Last reply Reply Quote 0
            • A
              Alan Kilborn @Ekopalypse
              last edited by Alan Kilborn Apr 5, 2020, 12:47 PM Apr 5, 2020, 12:44 PM

              @Ekopalypse said in Multi-cursor editing:

              For example: FINDOPTION.values() would return

              Just a slight note for any future readers:

              FINDOPTION.values() at the Pythonscript console yields:

              >> FINDOPTION.values()
              Traceback (most recent call last):
                File "<console>", line 1, in <module>
              TypeError: 'dict' object is not callable
              

              The proper thing to do is FINDOPTION.values (no parentheses).

              1 Reply Last reply Reply Quote 2
              • E
                Ekopalypse
                last edited by Apr 5, 2020, 12:54 PM

                Ooopps - you are right, thx for reporting.
                Seems I have wrapped it incorrectly with my python3 plugin.

                Yes, not every enum has really the same, but most of the time similar, name as the normal c-headers have.
                To get all the enums you can run globals() in the console or from a script.

                A 1 Reply Last reply Apr 5, 2020, 12:57 PM Reply Quote 1
                • A
                  Alan Kilborn @Ekopalypse
                  last edited by Apr 5, 2020, 12:57 PM

                  @Ekopalypse said in Multi-cursor editing:

                  my python3 plugin.

                  gimme, Gimme, GIMME! :-)

                  1 Reply Last reply Reply Quote 2
                  • E
                    Ekopalypse
                    last edited by Apr 5, 2020, 1:07 PM

                    I’m sorry, but it’s still an alpha version.
                    As long as not all functions/methods work as described
                    you’re not really gonna enjoy it.
                    Had a nasty plugin crash yesterday because instead using
                    an signed integer I used an unsigned one. :-(

                    But there will be fewer and fewer open issues.
                    And since I was wrong with the release date several times,
                    I prefer not to give a forecast until when a beta version can be expected.

                    The actual situation, Corona, has one advantage - I have more time to work on PySnack (That’s what I want to call it).

                    1 Reply Last reply Reply Quote 3
                    • A
                      astrosofista @Ekopalypse
                      last edited by Apr 5, 2020, 4:04 PM

                      @Ekopalypse said in Multi-cursor editing:

                      Thanks for testing and improving.

                      Glad to be of help. Let me know if more tests are needed.

                      Best Regards.

                      1 Reply Last reply Reply Quote 1
                      • M
                        Michael Vincent @dail
                        last edited by Apr 5, 2020, 11:05 PM

                        @dail said in Multi-cursor editing:

                        I use BetterMultiSelection

                        As do I - along with SurroundSelection and DoxyIt . Do you still support DoxyIt , I submitted a pull request a little while back.

                        Cheers.

                        D 1 Reply Last reply Apr 6, 2020, 11:40 AM Reply Quote 0
                        • D
                          dail @Michael Vincent
                          last edited by Apr 6, 2020, 11:40 AM

                          @Michael-Vincent

                          Personally I haven’t used DoxyIt in years. I wouldnt say it’s not supported, just my interest is quite lacking.

                          In light of recent circumstances I find myself with copious amounts of free time currently, so I will make it a point to take a look at your PR soon.

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