Community
    • Login

    Search++: A work in progress

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    109 Posts 7 Posters 29.8k Views 2 Watching
    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.
    • CoisesC Offline
      Coises @guy038
      last edited by

      @guy038 said:
      First, many thanks for adding the Find in Files capability within the Search++ plugin.

      Thank you for trying it!

      It’s important to emphasize that the Filters search is always a NON-SENSITIVE search.

      I made it that way by default since file and folder names are not case sensitive in Windows. You can still prefix the expression with (?-i) to make it case sensitive. I don’t know if the API I use to retrieve file paths from a folder is guaranteed always to return names in the correct case, but it appears that it does.

      Now, is there a particular reason for not allowing the ICU search ?

      Just the same as before — allocation of time and effort. ICU is not a “drop-in replacement” for Boost::regex; it would have significantly delayed me being able to release a public version of this had I included ICU search. Since Notepad++ users are already familiar with Boost::regex syntax, and I am more familiar with its programming interface (and so can work with it more quickly than ICU), I have prioritized Boost::regex.

      I am not ruling out adding it later. I will say, though, that I plan to study and attempt to incorporate its useful unique features into Boost::regex before spending too much time trying to implement additional ICU search variants of Search++ functions. It remains to be seen whether I can successfully fork Boost::regex and extend/enhance it to make the ICU search option redundant. It definitely helps me that you are making note of ICU features you miss in Boost::regex.

      Regarding the Search++ Results dialog :

      • Would it be possible to add a Purge option, like in the context menu of the N++ Search results dialog ? You could use the same label Purge for every search or some equivalent ( I do like Purge before each search )

      That makes sense and sounds possible. I’ll add it.

      • Although written in your files list, I also noted that the number of scanned files is not reported in the Search++ Results** dialog, unlike with the N++ **Search results` dialog

      And, if possible, it would be best to include the chosen options of the current regex too, like Regex, Case,... ?!

      Agreed. I’ll add that information.

      To end with, I noticed that, within the N++ Search results, it is possible to easily see all files which has matches, without seeing the matched lines :

      • By hitting Ctrl and clicking on ⊟, on the first line => The search collapsed after some time and then with a simple click on ⊞

      • By using the Fold All option of the Context dialog and then a simple click on ⊞ of the first line

      I see your point. There is some flexibility missing. I will look for a way to make that easy to do.

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

        @guy038 said:

        Regarding the Search++ Results dialog :

        Would it be possible to add a Purge option, like in the context menu of the N++ Search results dialog ? You could use the same label Purge for every search or some equivalent ( I do like Purge before each search )

        A question about this. Since it is in a sense a “destructive” option, do you think it should be remembered across Notepad++ sessions, or should it have to be invoked afresh in each session where you want it enabled?

        1 Reply Last reply Reply Quote 0
        • guy038G Offline
          guy038
          last edited by guy038

          Hi, @coises,

          In my opinion, this option seems more like a way of working than a delete option. So, I think this option should remain active between Notepad++ sessions. Note that it’s presently the case within the N++ Search results panel.

          But, of course, on re-opening N++, the N++ Search results and the Search++ Results panels are both cleared silently, before any search !

          After opening Notepad+ and a first search, involving the N++ Search results or the Search Results panels, you can easily un-check that Purge option if you plan to compare multiple searches !

          BR

          guy038

          1 Reply Last reply Reply Quote 1
          • CoisesC Offline
            Coises
            last edited by

            Search++ version 0.6.1 is available.

            This update enhances the Search++ Results list, including adding more detail to the search headers, implementing an “automatically purge” toggle and recognizing single-click in the margin.

            All comments, critiques and thoughts are welcome!

            @guy038 said:

            • Would it be possible to add a Purge option, like in the context menu of the N++ Search results dialog ?
            • Although written in your files list, I also noted that the number of scanned files is not reported in the Search++ Results** dialog, unlike with the N++ **Search results` dialog

            […]

            And, if possible, it would be best to include the chosen options of the current regex too, like Regex, Case,... ?!

            To end with, I noticed that, within the N++ Search results, it is possible to easily see all files which has matches, without seeing the matched lines

            This update addresses all those points. See the help for details about the commands in the results list.

            I’m not handling folding quite the same way as Notepad++ does. (It could be that in time I will decide to try to emulate Notepad++’s appearance and behavior more closely.) What I did was add a context menu option (also available as Shift+Enter or Shift+double-click) for search header lines that toggles the fold state of all documents in that search without folding the search itself. So if you select Expand/Collapse Search, or double-click, the search folds or unfolds with the folding of documents within it unchanged. If you select Expand/Collapse Documents, or Shift+double-click, when the search is expanded, all documents within that search either expand or collapse (the opposite of whatever is the state of the first document).

            I added a few other things, like clicking in a margin being equivalent to double-clicking in a header line or on the first position in a detail line. There is a purge toggle now, and search header lines include information about how many files were searched and the type of search (including modifiers).

            1 Reply Last reply Reply Quote 2
            • guy038G Offline
              guy038
              last edited by guy038

              Hello, @coises and All,

              Thanks for this quick new version. And many thanks for implementing all propositions that I suggested ;-)) So far, everything seems to work nicely !


              Now, one request :

              • Would it be possible, in the Search++ Results to prevent the displaying of the last character ( an ? sign inside a rectangle ) in all lines ( Search line, Document lines and Matched lines ) ? Personally, I think it globally makes the display harder to read ! Just a personnal appreciation

              And one question :

              Natively, you can swap the keyboard focus between the N++ Search results and the Current document window by hitting the F7 key. I do not see an equivalent with your Search++ plugin

              I mean :

              When, both, the Search++ and the Search++ Results panels are opened, you can swap the keyboard focus between them with the Ctrl + H shortcut. How to toogle between the Search++ Results and the Current document window ?

              Best Regards,

              guy038

              CoisesC 1 Reply Last reply Reply Quote 0
              • guy038G Offline
                guy038
                last edited by guy038

                Hi, @coises and All,

                Sorry, but I came across a serious bug regarding the ICU search, since Search++ version v0.6

                • The Find in Selection, Find in Marked Text and Find in Whole Document options

                • The Find All in Selection, Find All in Marked Text and Find All in Whole Document options

                Triggers the closure of Notepad++, without saving any configuration file and unsaved tabs


                After some quick tests :

                • The Select, Mark and Show options,

                • The Count in Selection, Count in Marked Text and Count in Whole Document

                Seems to work correctly in ICU mode

                BR

                guy038

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

                  @guy038 said:
                  I came across a serious bug regarding the ICU search, since Search++ version v0.6

                  Thank you for the detailed report. I can reproduce it… in the release version. It doesn’t happen in a debug version (which uses exactly the same code); so it’s a subtle error somewhere. I will find it.

                  I changed some existing code when I added Find in Files. You observation that this fault began in 0.6 will help me know where to look.

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

                    @guy038 said:

                    • Would it be possible, in the Search++ Results to prevent the displaying of the last character ( an ? sign inside a rectangle ) in all lines ( Search line, Document lines and Matched lines ) ?

                    Huh. I know what must be causing that, but I don’t know why it is causing it (on your system, but not on mine). (I set line ending characters to be displayed, but then to display with zero opacity. I do this so the marks I place to indicate a zero-length match will still show when the match occurs at the end of a line. The mark must be placed on the following character, and if the character isn’t shown, neither is the mark.)

                    Would you tell me what font you use for Notepad++ documents (the Search++ Results window copies that from the document window) and what you have at Settings | Preferences… | MISC. for rendering mode (GDI or DirectWrite)?

                    If I can figure out why you see the characters, hopefully I can figure out what to change so that you (and others with the same configuration) won’t see them.

                    Natively, you can swap the keyboard focus between the N++ Search results and the Current document window by hitting the F7 key. I do not see an equivalent with your Search++ plugin

                    The problem is that Search++ can’t (or shouldn’t… see below) control what shortcut keys do when focus is in Notepad++.

                    From the Search++ Results window, Ctrl+N will take you to the document. To switch from the document to the Results, though, I’d have to add a Search++ Results entry on the Plugins | Search++ menu, and then you’d have to set a shortcut for that in the Notepad++ shortcut mapper. You probably wouldn’t want to give up Ctrl+N, though.

                    The only way to get from Notepad++ to Search++ (or any plugin) is through a shortcut that’s either manually added in Shortcut Mapper or added by default in the plugin’s setup. (I’m still not sure how conflicts are resolved when a plugin defines a shortcut key that is already defined by default, by the user or by another plugin. I did define a few shortcut keys in Columns++ for manipulating rectangular selections, but it still bothers me that it feels a little… arrogant… to do that. My plugin might not be as important to the user as something else that also wants those keys.)

                    I am open to suggestions on how to manage this. I agree that consistency between navigation keys used when focus is in the plugin and when focus is in Notepad++ would be desirable, I just don’t have a plausible design for it.

                    1 Reply Last reply Reply Quote 0
                    • guy038G Offline
                      guy038
                      last edited by guy038

                      Hi, @coises,

                      Practically, I installed your plugin Search++ on a 8.9_x64 version of N++

                      As you can see, in the screenshot below :

                      f4e33f66-0743-43a9-9a4f-29e9c401507f-image.jpeg

                      • I did not hit the Show All characters option ( ¶ )

                      • I did a search on a specific folder ( ^Music )

                      • Most of the time, I use the Consolas font ( Consolas / Version 7.00 / Disposition **Open Type** signé numériquement **True Type Contours )

                      But you found out the culprit : it’s just because the GDI ( most compatible) option was selected !. Luckily, for any other option of the rendering mode, after closing an re-starting N++, this special character does not display, anymore !


                      Regarding the problem about swapping between the Search++ Results and the Current Document window, do not bother about it :-))

                      May be, you remenber that I personally used the Ctrl + Shift+ N shortcut to open the Search... option. Thus, each use of the Ctrl + Shift + N, alternatively, opens or closes my Search... docked panel

                      So, I was able to deduce a way ( rather long, of course ) to do that :

                      • Firstly, use Ctrl + N shortcut to switch to the Current Document window

                      • Secondly, use the Ctrl + Shift + N shortcut to put the focus on the Search.. panel

                      • Thirdly, use the Ctrl + H shortcut to get the focus on the Search++ Results panel, again !

                      Even, on my French keyboard, the H key is quite close to the N key !

                      BR

                      guy038

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

                        @guy038 said:

                        But you found out the culprit : it’s just because the GDI ( most compatible) option was selected !. Luckily, for any other option of the rendering mode, after closing an re-starting N++, this special character does not display, anymore !

                        Thanks for documenting that!

                        It should appear correctly in GDI mode too, of course. I suspect the problem will turn out to be that GDI mode doesn’t support alpha transparency, so my setting the opacity to zero is doing nothing. I’ll have to find another way.

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors