Community
    • Login

    Search++: A work in progress

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    34 Posts 7 Posters 1.3k 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.
    • CoisesC
      Coises @guy038
      last edited by

      @guy038 said in Search++: A work in progress:

      Regarding the possibility of changing the Alt + F and Alt + R shortcuts to some anothers, I’m not really in favor of it because you would break a very old Windows standard !

      True. I would not change them; I was thinking about adding Shift+Enter and Ctrl+Enter as alternatives.

      • Using the Alt + F shorcut does move to the next match and, in addition, the shortcut Alt + Shift + F does move to the previous match Nice, indeed !

      That was a “bonus.” It hadn’t occurred to me that Shift would work that way, though now that you mention it, I can see why it does.

      • But, if I decide, now, to use the Enter key, it wrongly add a line-break after the word and , in the Find dialog of Search++

      So, to my mind, it would be better to put the focus on the Find button as soon as you hit the Alt+ F shortcut, in order to use, either, the Alt + F OR Enter and the ALT+ Shift + F OR Shift + Enter shortcuts !

      The Windows dialog manager doesn’t normally move focus for an Alt+ shortcut to a command button, it just does the command and leaves the focus unchanged. I could probably find a way to override that, but it’s not clear to me that I should. If you started using Alt+F, why not continue that way?

      This does make me think I should probably have an option, perhaps enabled by default, to return focus to the document automatically after a select operation, since wanting to copy is probably the most common reason for using select.

      Yes indeed; this would make sense !

      It will be in the next release.

      BTW, @coises, why didn’t you choose a single shortcut ( I’m thinking about Ctrl + H ) to toggle between the Search++ plugin and the Search++ Results ? Native notepad++ just use the F7 key to shift the focus, back and forth, between the Document window and the Search results panel !

      I suppose I was thinking that since I can’t really make one command that handles all the focus changes — because I don’t know what the user will assign for Search++/Search in the Notepad++ shortcut mapper (if anything at all) — I would have Ctrl+N always go to the document, Ctrl+O always go to the Search dialog (though it’s Find Box unless you’re already in the Find Box, in which case it’s the Replace Box…) and Ctrl+H always go to the results (“hit list”).

      It would make at least as much sense to have Ctrl+H toggle between the search dialog and the results list, though. Since you mention it, I’ll probably make that change.

      There’s nothing weird about this assertion. It just means that the behavior of the (?w) and (?-w) modifiers act in the same way

      Of course, you are correct.

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

        @guy038 said in Search++: A work in progress:

        • Put the focus again on the Search++ plugin ( with Plugins > Search++ > Search... or with my shortcut Ctrl + Shift + N )

        => The text is not uptaded and remains the string This is a test ! To get it updated, you need to close and re-open Search++

        Could you provide this N++ search behavior to Search++, as well ?

        I did not realize the native dialog worked that way; I assumed it only filled when the dialog wasn’t already open.

        I don’t see a reason I couldn’t do this, if it’s what people will ordinarily expect. I would have thought being able to change focus back to the dialog by keyboard without disturbing the contents of the Find box would have been more desirable, but maybe not. Users can always disable the fill option, or I could add an additional setting to let the user decide whether filling only occurs when the dialog wasn’t already open.

        Ctrl+I will insert the text selected in the document into the Find (or Replace) box at any time. Since it is an insert, you have to do Ctrl+A, Ctrl+I if you want to replace.

        When the Search++ dialog is docked, it’s very easy to identify if focus is on Notepad++ or on Search++, thanks to the blue color of the title bar. However, this difference is not so obvious when the Search++ plugin is not docked ! Is there a mean to improve this difference ?

        Agreed, the difference is fairly subtle in light mode: the text in the title bar goes grey, and the shadow around the dialog gets a bit less. It’s a bit more visible in dark mode, where the whole title bar changes color.

        I have to think about whether there is anything I can do that would make this more visually apparent without being garish or peculiar.

        (Note: at present, the Search++ dialog does not fully accommodate changing between dark and light mode within a single Notepad++ session. The Scintilla controls in the regular dialog and in the docking dialog stay however they were when you first opened that type of dialog.)

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

          @guy038 said in Search++: A work in progress:

          You said :

          This does make me think I should probably have an option, perhaps enabled by default, to return focus to the document automatically after a select operation, since wanting to copy is probably the most common reason for using select.

          Yes indeed; this would make sense !

          […]

          BTW, @coises, why didn’t you choose a single shortcut ( I’m thinking about Ctrl + H ) to toggle between the Search++ plugin and the Search++ Results ?

          A few small improvements are in version 0.4:

          • Add wide layout for better top/bottom docking. Improve layout handling and make sure non-docking dialogs aren’t sized too small.
          • Add settings (checked by default) to focus the document after Select commands and after Show commands. (See help.)
          • Make behavior of general navigation commands (Ctrl/Ctrl+Shift + H/N/O) more consistent. (See help.)
          1 Reply Last reply Reply Quote 0
          • L
            Lachlanmax
            last edited by

            Nice work so far. Notepad++ already has a solid search system, so making something which actually feels like an upgrade is not small thing.

            What is standing out to me is that it follows the way heavy N++ users already search instead of trying to force whole new workflow. The extra scope control feels especially useful when you start doing repeated searches in same session, because built-in search can get a bit messy.

            One thing I personally really miss is Find + Mark (highlight/coloring results) style workflow. Being able to keep visual marks in document while refining searches is something I use very often in native N++, so having similar option here would make it even stronger. Related to that, I also really love Bookmark option in native N++, which I am not sure is used regularly by everyone, but to me it is very helpful, being able to quickly jump between important lines makes managing large documents much easier.

            It would also be very nice to see these strong features later applied to Find in Files / Find in Directory, like Notepad++ handles it now, because that is where extra scope logic and result control could become even more useful.

            Hopefully I will be able to contribute something useful to this community soon also.

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

              Hello, @coises and All,

              Many thanks for your reactivity and for the Search++-04 release ! I do appreciate that you always keep the Help file up to date with the latest version and it’s a pleasure to consult it !

              Bravo for the Keyboard navigation section, within the Help file and for the Focus section in the Settings dialog with their default values !


              • Regarding updating the Find dialog when selecting something new in a document :

              In your last post, I did not notice that you spoke about the Ctrl + I shortcut. So, presently, in order to update the Find region of Search++ with current selection of current document, we have two possibilites, when Search++ is on focus :

              • Use the Ctrl + I or the combination Ctrl + A + Ctrl + I

              or

              • Use the Ctrl + Shift + N shortcut to close Search++ ( Search++ shortcut )

              • Re-use the Ctrl + Shift + N shortcut to open again Search++ ( User shortcut )

              BTW, @coises, the Help file did not mention at all that Ctrl + I shortcut !

              Best Regards,

              guy038

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

                @guy038 said in Search++: A work in progress:

                In your last post, I did not notice that you spoke about the Ctrl + I shortcut. So, presently, in order to update the Find region of Search++ with current selection of current document, we have two possibilites, when Search++ is on focus :

                • Use the Ctrl + I or the combination Ctrl + A + Ctrl + I

                or

                • Use the Ctrl + Shift + N shortcut to close Search++ ( Search++ shortcut )

                • Re-use the Ctrl + Shift + N shortcut to open again Search++ ( User shortcut )

                BTW, @coises, the Help file did not mention at all that Ctrl + I shortcut !

                Thank you again for looking at this so closely.

                The help file mentions in this section that there is a context menu on which you can also find keyboard shortcuts:

                Right-click in the Find or Replace box, or use the Apps key or Shift+F10, to bring up a context menu. A number of useful commands can be found there, along with their keyboard shortcuts. The bottom section of the context menu lets you select from a history of the last ten strings you have used for searches.

                I go on to mention wrapping and zooming, but I never describe the Insert/Exchange sub-menu.

                in order to update the Find region of Search++ with current selection of current document, we have two possibilites, when Search++ is on focus

                There are already settings to choose whether to fill the find box at all, and if you choose to fill, to set some limits on how big the selection can be.

                Do you now think:

                1. there should be another sub-setting for whether or not to replace the contents of the find box when you use the Search++ Search… menu command or the shortcut you’ve set for it to move focus from the document to a search dialog that is already visible? (If so, should it be default checked?)

                2. if the main “Fill” box is checked, it should always fill when you use the command/shortcut, regardless of whether the dialog is visible — if someone doesn’t like it, they can just turn off filling altogether (it’s not that hard to use Ctrl+I when you want it)?

                3. it should stay like it is (it’s not that hard to use Ctrl+I when you want it)?

                My personal feeling is that it would be disconcerting to have what is in the Find field, in a visible dialog, replaced just because I used my keyboard shortcut to navigate to the dialog instead of activating it with the mouse. (If I’ve closed the dialog I probably don’t remember what was in it anyway, so the selected text is as good as anything.) Others might not see it that way — I rarely use auto-fill intentionally. Most often I’m not already looking at the thing I want to find; so just unchecking the box and turning it off completely wouldn’t affect me much.

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

                  @Lachlanmax said in Search++: A work in progress:

                  Nice work so far. Notepad++ already has a solid search system, so making something which actually feels like an upgrade is not small thing.

                  Thank you.

                  One thing I personally really miss is Find + Mark (highlight/coloring results) style workflow. Being able to keep visual marks in document while refining searches is something I use very often in native N++, so having similar option here would make it even stronger.

                  Would you help me understand what is missing? I assume you have seen the Mark command (the simple one and its family of direction- and scope-controlled commands) on the drop-down for the Find All button, and the mark-related functions on the Tools button menu. What do I need to add? Other than…

                  Related to that, I also really love Bookmark option in native N++, which I am not sure is used regularly by everyone, but to me it is very helpful, being able to quickly jump between important lines makes managing large documents much easier.

                  I did leave that out. I’m one of those people who doesn’t use them, so I have little insight into how people do use them.

                  I take it the essential option here is to set a bookmark on every line that contains a match when using a Mark command. Is that it?

                  Do you think that is something that can be a setting — that is, something a user would ordinarily either use or not use, so it can go on the Settings dialog and any given user will “set it and forget it”? Or is bookmarking the lines containing matches something a user needs to be able to turn on and off search by search?

                  Can bookmarks be cleared along with marked text, or do users need independent control of unmarking text and clearing bookmarks?

                  Should lines containing null matches (which can’t be marked, as there is no text to mark) still be bookmarked?

                  It would also be very nice to see these strong features later applied to Find in Files / Find in Directory, like Notepad++ handles it now, because that is where extra scope logic and result control could become even more useful.

                  I’m not sure I understand what this would entail.

                  (I haven’t yet added the ability to search in files on disk, nor the ability to search all open documents. Those are major steps I still intend to take before I consider this ready for a “stable” release.)

                  Are you suggesting that some sort of marked text and/or bookmarked lines be maintained in files that have never been opened in Notepad++? It sounds confusing to me; wouldn’t users be completely “flying blind” trying to assess how their searches were actually working?

                  I can’t help thinking that maybe complex, chained series of searches and replacements in sets of files on disk might be better handled by a separate tool (likely a command line tool which could have an optional GUI interface) that wouldn’t have anything to do with Notepad++. I don’t know if a good, user-friendly program like that exists.

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

                    Hi, @coises and All,

                    Regarding selection, I’m thinking about these new options in the Settings dialog :

                    - Selections -------------------------------------------------------------------------------------------
                    
                    □ Fill the Find box from single selection in current document when opening the search++ dialog
                    
                    □ Fill the Find box from single selection in current document when re-activating the search++ dialog
                    
                    □ Fill the Find box from single selection in current document when clicking on the search++ dialog title
                    
                    □ Only if the selection has no more than :  79  characters and  2  lines
                    
                    □ Fill with the word containing the caret if nothing is selected
                    

                    And, by default, the first and two last options would be checked

                    Do you think that make sense ? May be, would you prefer to merge the first 3 options in this single one :

                    □ Fill the Find box from single selection in current document each time the search++ dialog is invoked
                    

                    Now, I tested the multi-lines text, below, pasted in a new tab :

                    Bla blah
                    This is
                    a test
                    to verify
                    if everything
                    works correctly
                    foo bar
                    

                    Then, the search of the 5 consecutive lines, below

                    This is
                    a test
                    to verify
                    if everything
                    works correctly
                    

                    Would select the 5 lines above, with search in Plain mode

                    Now, the search of the 5 consecutive lines, below

                    This is
                    a test
                    to verify
                    if everything
                    works correctly
                    

                    OR

                    SEARCH This is\Ra test\Rto verify\Rif everything\Rworks correctly\R

                    OR

                    SEARCH This is\r\na test\r\nto verify\r\nif everything\r\nworks correctly\r\n

                    Would select the 5 lines above, with search in Regex or ICU mode


                    Now using this regex :

                    (?x)
                    This[ ]is         \R |
                    a[ ]test          \R |
                    to[ ]verify       \R |
                    if[ ]everything   \R |
                    works[ ]correctly \R
                    

                    It would match each entire line, from 2 to 6, of the new tab, with search in Regex mode

                    And using this regex :

                    (?x)
                    This\ is         \R |
                    a\ test          \R |
                    to\ verify       \R |
                    if\ everything   \R |
                    works\ correctly \R
                    

                    It would match each entire line, from 2 to 6, of the new tab, with search in Regex or in ICU mode.

                    Seemingly, brackets to enclose the space character [ ] do not work with the ICU regex engine, when using the Free-Spacing mode !?

                    So, all is fine, so far !!

                    BR

                    guy038

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

                      Search++ v0.5 includes various changes:

                      It is now possible to Count, Find All, Mark or Replace in Open Documents or in Documents in this View.

                      When the search dialog is narrow (typical if the docking dialog is used and docked to the left or right), the status message can overflow the available space. I added ellipsis to the message and a balloon tip on hover to show the whole message when it overflows.

                      I changed the default (“smart”) Mark commands so that they don’t search only within marked text when some text is marked. That search is possible (Mark in Marked text is on the Mark submenu), but it’s probably not what someone usually means to do.

                      I tried to make the command button drop-down menus make a little more sense. They’re probably still confusing. I updated the description in the help; hopefully if someone really wants to understand what it all means, I’ve made it possible.

                      Experiences, problem reports, suggestions and trauma dumps are still welcome and very much appreciated.

                      Still not done:

                      • @guy038’s disappointment with the Find field not being filled from the document selection in as many situations as he expects remains to be addressed.

                      • I haven’t looked at @Lachlanmax’s request to include bookmarking lines yet. Using marked text in multiple documents was also mentioned; the changes in 0.5 possibly address that to some extent, but only for open documents, since I haven’t added any searching of files on disk yet. I’m not sure how I could/would apply the idea of searching in marked text to documents that aren’t open in Notepad++.

                      • When accumulating a lot of search results (tens or hundreds of thousands of hits), the search completes and then everything hangs while the results window is filled. It can be confusing and disconcerting.

                      • The drop-down menus for the command buttons drop up when the button is near the bottom of the screen. That’s OK, except that the menu then covers the place you just clicked to open it, and if you happen to move the mouse just a pixel before you release the button, it selects the bottom item in the menu.

                      • I still haven’t fixed the search results window for dark mode.

                      • I still don’t have a convenient method of keyboard access to the command button drop-down menus. (I can and probably will assign some shortcuts to them, but they still won’t be discoverable to anyone who doesn’t read about them in the help.)

                      • As @guy038 noted, the icons added to the command buttons when you shift+click to set a different primary action for the button are difficult to make out. The reason for that is that I’m using Unicode symbol characters; eventually I need to replace them with proper icons or owner-drawn buttons.

                      • I still haven’t implemented find in files. I’m not sure yet how I will manage the user interface: I don’t want to make the main dialog bigger (I want to keep it practical for docking use).

                      • I hope to add the ability to save searches for future use, but I haven’t done that yet.

                      • Searching in Open Documents or in Documents in this View loses multiple selections that aren’t a rectangular selection. That’s because Notepad++ loses them when switching tabs, and I think the only safe and robust way for a plugin to access open documents is to temporarily activate them. There might be other things that are lost, too; I need to identify them and save/restore them. (Hidden lines are lost, but that’s for a different reason.)

                      • Hidden lines as Search++ uses them don’t work together properly with hidden lines the way Notepad++ uses them. It is not clear to me yet what is possible there; I hate to give up the Show command, as it is a handy way to get the effect of a search results list but right in place, where you can edit what you see.

                      • While there is a search progress dialog, it doesn’t always show up when it should. The biggest problem is long searches that don’t find anything. (Those are usually regular expression searches, at their worst resulting in the infamous “too complex” message.) It will be a tricky problem to solve, because the Boost.Regex engine doesn’t have any sort of callback for long operations: once I start a search, my code doesn’t get control again until it either finds something or fails to find anything. I suspect there will be no effective way to solve that without modifying Boost.Regex code.

                      Snabel42S 1 Reply Last reply Reply Quote 1
                      • Snabel42S
                        Snabel42 @Coises
                        last edited by Snabel42

                        @Coises I was though to mention this for 0.4, but FYI it remains in 0.5.
                        I’ve highlighted tha the “Mark Style” drop down appears to be populated with non-english characters, even though the remaining UI is english. When clicking the dropdown to show values, this value does not exist in the revealed list of choices

                        93536946-7e7c-42c7-b990-3ecd72819674-image.png

                        50642f8f-33dc-4c37-83a9-f20560dc29be-image.png

                        Notepad++ v8.9.3 (64-bit)
                        Build time: Mar 20 2026 - 00:44:25
                        Scintilla/Lexilla included: 5.6.0/5.4.7
                        Boost Regex included: 1_90
                        pugixml included: 1.15
                        nlohmann JSON included: 3.12.0
                        Path: C:\Program Files\Notepad++\notepad++.exe
                        Command Line:
                        Admin mode: OFF
                        Local Conf mode: OFF
                        Cloud Config: OFF
                        WinGUp: present
                        disableNppAutoUpdate.xml: absent
                        Periodic Backup: ON
                        Placeholders: ON
                        Scintilla Rendering Mode: SC_TECHNOLOGY_DIRECTWRITE (1)
                        Multi-instance Mode: monoInst
                        asNotepad: OFF
                        File Status Auto-Detection: cdEnabledNew (for current file/tab only)
                        Dark Mode: ON
                        Display Info:
                        primary monitor: 2560x1440, scaling 100%
                        visible monitors count: 2
                        installed Display Class adapters:
                        0000: Description - NVIDIA GeForce RTX 3080
                        0000: DriverVersion - 32.0.15.9186
                        OS Name: Windows 11 Home (64-bit)
                        OS Version: 25H2
                        OS Build: 26200.8037
                        Current ANSI codepage: 1252
                        Plugins:
                        CollectionInterface (1.3)
                        ColumnsPlusPlus (1.3.1)
                        ComparePlus (2.2)
                        CSVLint (0.4.7)
                        CsvQuery (1.2.9)
                        FWDataViz (2.6.7)
                        HTMLTag (1.5.6)
                        HugeFiles (0.4.1)
                        JsonTools (8.5)
                        mimeTools (3.1)
                        MultiReplace (5.0.0.35)
                        NppConverter (4.7)
                        NppExport (0.4)
                        NppXmlTreeviewPlugin (2)
                        PythonScript (2.1)
                        Search++ (0.5)
                        XMLTools (3.1.1.13)

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

                          @Snabel42 said in Search++: A work in progress:

                          I’ve highlighted tha the “Mark Style” drop down appears to be populated with non-english characters, even though the remaining UI is english. When clicking the dropdown to show values, this value does not exist in the revealed list of choices

                          Thank you for the report and the screenshots. I couldn’t reproduce it until I changed to dark mode (to match your screenshot).

                          The control functions perfectly well in light mode and is completely messed up in dark mode.

                          I will investigate to see if I can find a cause and/or a workaround.

                          I have the same control in the Search dialog in Columns++, but I never added the Notepad++ message to support dark mode to anything in Columns++. The control works there, regardless of whether Notepad++ is in light or dark mode, so it seems specifically to be connected with the dialog being in dark mode.

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