Find & Replace & Mark re-organization proposal
-
Note, the message above is incomplete
I could not complete it due to hitting the image posting limit.
And now the edit window as passed

So I have to finish the original message as a reply
and last is a toggle switch
This means âcopy whole lineâ I should add the âcopyâ symbol as well.
What this does when active, is when you click Copy Highlights, instead of copying only the exact highlight, which is just your find string with various case, it will copy the whole lines which contain highlights, which I think is more useful.
That one might not even be a toggle. I thought it would be a toggle because it could affect bookmark as well, but actually, âcopy bookmarksâ already copies the entire bookmarked lines. So probably this should just be a separate actionâcopy entire lines that include highlightsâ

Ah and the setting button, would serve to hide the important settings that we donât need to interact on a day-to-day basis, but easier to get there than going to preference->whatever->etcâŚ

And of course, once we have a single layout like this, itâs easy to put a layout toggle in the settings menu
Example hiding the Mark/Bookmark section

Also, didnât have the time to include it and I have no more credits to make images but I would add a button to change the colours of âhighlight/marksâ so you can have multiple sets of highlighted terms with different colours. (Also I would make these sets independantly copiable/deletable from a list somewhere else)
hiding replace all in all documents

Hide replace functions

Here are lightmode versions of the reduced versions
Reduced (minus replace all in all document, minus Mark function )

Find only variant

And here are the suggested layout switches, in the setting/gear icon popup dialog


And of course, you tell the user what each button does via the use of button tooltip text
I would also put clickable yellow (?) buttons that you can click to open information page about the use of this dialog
-
- Provide live counts for search, that update as you type, eliminating the need for the Count button entirely as well as providing prev/all/next counts
Yikes! You apparently donât use large files and/or exceedingly complex regular expressions. Even I have very-rarely needed to run searches that take minutes to run (and some unfortunate users must do that much more frequently than I do). The search engine can only run one search at a time, so every time I updated the regex, it would have to wait minutes to update the âliveâ count(s) before I could run the replacement I wanted. No thank you.
-
Thanks for info and I think we can all agree that the monstrosity should only be seen on the first of April, if THEN.
Iâve read issue 16229 and it was quite informative. I may have at one time been aware of the search settings in preferences, and the arrow to switch between compact and extended view. But I had forgotten all that.
I was NOT aware of the selection checkbox, which started the whole thing, even though itâs in front of me every time I do a search or replace. Itâs a sign of my not using the feature. but now that I see it, I have opinions
Inside selection is kind of meaningless if Iâm searching all opened documents or within files. Rather than a separate dimension, I think it should be part of the hierarchy of search scope: Find, Find All in Selection, Find All in Document, Find All in All Opened Documents etc.
@shodanx2
Thanks, the dark mode was difficult to make out on a smaller screen. and thanks for a list of things-
In Selection Toggle: as noted above, I donât like the way it is currently implemented. and an auto toggle seems confusing.
-
Find / Replace / Mark Tabs: Honestly, this doesnât bother me here. In general, I think I lean towards liking a tabbed interface
-
Input Copy/Swap Function: I so rarely swap and never copy, that having a drop down doesnât bother me. Iâm neutral on this sort of change
-
Wider Search and Replace fields: I am not hampered by the size right now. If we could rearrange and make larger, great! If not, great!
-
Transparency Settings: If I had single monitor and my search window was over the editor Iâd make use of this. I donât see a need to keep it. If we could use that space for something else, fine.
-
Split Find Next Toggle: meh. It it were up to me, Iâd make the the bidirectional buttons the only option, or at least move the choice to Preferences.
-
Live Counts: I Like putting the counts in the text of the buttons. Iâm not sure how hard it would be to implement, but pretty
-
Locking Replace All. No. If we have the option set in Preferences, weâre already confirming the change. thatâs just extra room.
-
Diacritics: Sure if thereâs space, why not?
Light Mode: I use a dark theme with my light Mode, so dialogs are a nice gentle gray, not blazing white.
- Smaller Learning Curve:
I really donât think so. Thereâs a lot on that screen that I donât want or need to know. which brings me to
Itâs too cluttered. A row of buttons on the right became a larger grid of buttons, but mostly, the icons
Youâve got two sets of icons in two different layouts and sizes. The search dialog is dominated by the icon grid on the left.
There are circumstances where icons are the best GUI element (toolbars) or are best in combination with text (the tabs in Notepad++ for example) But in a number of the cases you described, I think the best element would be a checkbox with explanatory text.
-
-
@PeterJones said:
The search engine can only run one search at a time, so every time I updated the regex, it would have to wait minutes to update the âliveâ count(s) before I could run the replacement I wanted. No thank you.I do occasionally open big files, I have one open right now.

That doesnât seem like much of a problem to me ?
Here is how to do it
- Put a filesize guard on the auto-count algorithm, so it just doesnât fire for files beyond threshold.
- Put a throttle delay so it canât fire again until a delay has passed, I think 100 millisecond / 10 hertz would still feel responsive while leaving ample room from 99% of files to search through.
- run the auto-count algorithm in another thread so it doesnât freeze the UI on especially big files (or, just reduce max file threshold)
- donât trigger auto-count algo until it returned
- Give auto-count algo a timeout value
- Give user disable auto-count toggle
- Manual count trigger by left click window background
I just checked how long the count algo actually takes.

On my 156 megabytes file that is 39 milliseconds.Let the user fiddle with the values you like, I suggest these default values. Use this layout.

-
- In Selection Toggle: as noted above, I donât like the way it is currently implemented. and an auto toggle seems confusing.
For me it was brutal, I thought I was going crazy, somehow that toggle was always the opposite of what I needed ! And ⌠it took me a loooooong time to discover that it changes on its own !!

1024 bytes it a selection threshold I am very often on either side of !
I understand the idea, âin selection if itâs big enoughâ but then you have to keep in mind where that threshold it, but counting 1024 character really is not obvious. Iâm not sure if it only enabled but I think it would also disarm when youâre under threshold.I have PTSD from that damn toggle ! My thousand+ steps windows configuration checklist has a line about disabling this feature. Separate buttons for replace in selection and replace in document solves that problem. Now where you click always does what you want.
- Find / Replace / Mark Tabs: Honestly, this doesnât bother me here. In general, I think I lean towards liking a tabbed interface
As I studied this dialog box, I realize that many many times I would have benefited from the highlight feature, but not if itâs an other tab. I need it but not often enough to remember it exists. Also having multiple highlights with different colour, having those highlights in a list, and preserving those highlight over np++ restarts as permanent highlighting of the text would be really nice.
- Input Copy/Swap Function: I so rarely swap and never copy, that having a drop down doesnât bother me. Iâm neutral on this sort of change
I didnât notice it was there, it was interface noise, I think I might use swap, if I remember it exists. Not a fan at all of a two click operation.
- Wider Search and Replace fields: I am not hampered by the size right now. If we could rearrange and make larger, great! If not, great!
I often paste long, really really long searches in there. Iâd like to see more of it, I also would like side-scroll to work on this textbox (currently side-scroll does horizontal scroll on it, thatâs a bug)
- Transparency Settings: If I had single monitor and my search window was over the editor Iâd make use of this. I donât see a need to keep it. If we could use that space for something else, fine.
I have 4x40" monitors

I always leave it translucent and itâs always absolutely all over the place. But I never needed to adjust it after the first time, it belongs in settings, but there should be a gear icon for settings on the search dialog.- Split Find Next Toggle: meh. It it were up to me, Iâd make the the bidirectional buttons the only option, or at least move the choice to Preferences.
I donât see why not always have prev/next, I use both extensively, only reason the toggle is there, in my opinion, is in case someone complains about it, to pre-emptively quiet them. But I donât think those people really exist. Thatâs why I call this a vestigial feature.
- Live Counts: I Like putting the counts in the text of the buttons. Iâm not sure how hard it would be to implement, but pretty
I really would like that, even if it does it 1 per second. Being able to just type and see how many results you got sounds soooo useful. You get an immediate look at what is going on. And with prev count and next count, you kind of can orient with it, like I type a function name, and at a glance I can tell if Iâm before of after it.
- Locking Replace All. No. If we have the option set in Preferences, weâre already confirming the change. thatâs just extra room.
This signals that button is not dangerous. You know how sometimes UI have buttons that if you click them something bad will happen. This happenned to me too often, I have PTSD about it. Even if thereâs a guard, it makes me nervous. I have never used it, but I see how it might be useful but I always have a bazillion files open in my session so that button is never safe, even though, I know thereâs a guard. But have you even misclicked something and then also bumped space by accident ? That would do it ! Aaaaaahahhhhh !
Light Mode: I use a dark theme with my light Mode, so dialogs are a nice gentle gray, not blazing white.
On my HDR oled monitor, it is so bright it lights up the room.
- Smaller Learning Curve:
I really donât think so. Thereâs a lot on that screen that I donât want or need to know. which brings me to
Itâs too cluttered. A row of buttons on the right became a larger grid of buttons, but mostly, the icons
Decluttering the layout is easy, just add more layout buttons in settings.
I would like either a âadvanced modeâ toggle. Or âlayout change on resizeâ where the bigger you make the dialog, the more buttons it adds. What just a find bar, shrink it until that is all there is.
Youâve got two sets of icons in two different layouts and sizes. The search dialog is dominated by the icon grid on the left.
Yes there is many other ways to do this. Once you know what the icons mean, like the regex symbol and case sensitive, you can make them much smaller and be able to pick them up very quickly. This layout feels right to me. I would really like a (?) hover help screen for the dialog.
In particular, having common regex expression like matching empty lines, matchin end of line, matching beginning of line. The perfect version would have a regex builder and the complete set of escape sequences ready to drag and drop into the textbox
I think symbols are more legible once you can recognize them.
-
- run the auto-count algorithm in another thread
Multi-threaded search has been rejected on the grounds that it breaks other features:
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/8329
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/3562#issuecomment-2242694908(That might be in just the context of a separate thread for each file searched during multi-file searches⌠but I believe that other âbackground threadingâ of searching has also been rejected, though I cannot immediately find an example.)
If your live-count solution relies on one or more new threads, donât count on it being accepted.
I think (but am not sure) that all your suggestions for âtimeoutsâ and the like would also require threads, which would probably make them a no-go as well.On my 156 megabytes file that is 39 milliseconds.
normal-search=
hrefis not a complicated regular expression, and thus you have a 39ms strawman there. As I said, I have seem minutes pass while searching. If you havenât experienced that, be thankful. But understand that freezing other peopleâs search dialogs for minutes before they can search, just because you want automatic âliveâ count, is not going to be accepted. (If that auto-count were limited to mode=normal searches, maybe, just maybe, it would be safe enough. But Iâm still doubtful.) -
That might be in just the context of a separate thread for each file searched during multi-file searches⌠but I believe that other âbackground threadingâ of searching has also been rejected, though I cannot immediately find an example.
From what Iâve seen, all search in Notepad++ runs through the Scintilla search interface. That by itself makes it impossible to separate search from the GUI thread without re-engineering how search works.
I did, somewhat, re-engineer search for Search++ and for Search in Columns++; for regular expressions, I use the raw data pointer from Scintilla and search it directly with Boost::regex. It might be possible to multi-thread Find in Open Documents that way, but probably not Replace (unless every document were duplicated in memory in the GUI thread, processed in a worker thread, then the whole document replaced in the GUI thread). One of the big hurdles I still have in Search++ is how Iâm going to do Find in Files. I do not want to open each file in an off-screen Scintilla control (which Iâm pretty sure is what Notepad++ does). The searching sounds simple until you consider code pages and how to locate the match in a Scintilla window if the user asks to see it by clicking in the search results. If I can design that (I just havenât had the mental space to take on the challenge recently), doing it multi-threaded sounds like it should be possible.
Another frustrating thing is that Boost::regex doesnât have any sort of progress callback while it is searching. Itâs easy enough to do periodic callbacks after finding one instance and before finding the next (each is a separate call to Boost::regex); but often the big delays happen while searching large spans of text where nothing is found. I hope, someday, to take on the challenge of modifying Boost::regex to do a callback instead of the dreaded âtoo complexâ message. That will be a ways down the road.
But any of this is way too much change, and way too likely to cause new bugs, for me to even think of suggesting it as a change to the base program. If anything, I think it would have to be a âparallelâ feature, rather than a replacement, which would have to prove itself viable over time⌠which is, Iâd say, appropriate for a plugin.
@shodanx2, if youâre able to code a plugin to show your concept in action so people can try it and actually demonstrate its value and reliability in real world use, that would be the way to go. If youâre throwing all this massive re-design out and thinking âsomebody elseâ will implement it, itâs not likely; consider smaller suggestions that can be integrated without disrupting the interface with which people are familiar or the battle-tested processing of the existing program.
-
-
-
Today I Learned. đ
-
Notepad++ counts for you
This is true; my point about âfeelâ was that, at least for me, if I select a âbunchâ of characters with a search in mind as the next action, of course I want it to be within that selection. Again, everyoneâs âbunchâ could be a different number (which is why the option is configurable), and it isnât a hard number in your mind, but there has to be a definite number for the software.
TL;DR: I have never watched the
Sel:item in the status bar when making a selection for this purpose. -
it isnât a hard number in your mind, but there has to be a definite number for the software.
Of course. And so you select what you âfeelâ is about right for your limit, and use the
Selnumber (rounded appropriately) to set the hard number for the preference entry. -
@PeterJones
I agree with Alan, to make this intuitive you have to be able to go by feel.Consider the following two selections


One of these is In Selection the other one is not.
And you donât usually get a side-by-side and one of these two will wreck your file if you donât notice what mode you were when you press Replace All.
One easy way to make this intuitive, would be to flip the text on the button and also to change the buttonâs colour, so you donât have to read it, you will feel it.
On the other hand, separate buttons for âin selectionâ and âin documentâ will not even need you to feel it, it will move to intent in your muscle memory. Both of these could exist as different layouts that you can toggle.
As for the âauto-countâ algorithm.
There is a way to make this work.
I understand that you call by 39 millisecond search on a 156 megabyte file a âstrawmanâ but you have to understand that, you can make arbitrary long regex time if you want.

There is a single thread solution to make this work.
You call the count algorithm but every 4 or 8 millisecond you call whatever the equivalent of DoEvents is in scintilla.
Combine this with the circuit breakers I described above and I think itâs very feasible and wonât freeze the UI. I think some other long running features in notepad++ could benefit from this. Because when I had this 156MB file loaded in np++ earlier, there was a lot of misbehaviour. Lots of freezing when simple moving the window, even though nothing changed on screen, just a simple translation.
Also this is just a particularly crunchy bit of the problem, the rest of the layout redesign doesnât have any difficulties except for some the new proposed features (boolean, fuzzy and semantic search are each their own can of worms).
-
There is a single thread solution to make this work.
You call the count algorithm but every 4 or 8 millisecond you call whatever the equivalent of DoEvents is in scintilla.
Scintilla calls Boost::regex. Boost::regex does not return until it either finds a match, exhausts the input, or trips its internal âthis looks like it might be an infinite loopâ flag.
There is nowhere to put that âDoEventsâ call (which wouldnât be a call to Scintilla, it would be a return from a dialog or window procedure with a zero-length timer set to call the procedure again after Windows updates).
You can (as in my linked example) do a periodic return between one search and the next, but you canât interrupt a single, long-running search. Thatâs annoying in my application, but would be fatal as proposed in this dialog.
-
the rest of the layout redesign doesnât have any difficulties except for some the new proposed features
You and I will have to disagree on that statement, because I know I cannot convince you, and donât feel like arguing with you anymore (hence the post that was live for a few minutes before I deleted it; itâs just not worth the effort).
But at this point, I want to emphasize @Coisesâ earlier suggestion: Make it a plugin at first. Try it out, take it round the block, learn the difficulties with the extra features you want, get it better, get it bulletproof. All the mockups in the world will count as nothing compared to such real-world proof. If people like it, maybe it will be to the 2020s what TextFX was to the 2010s: a plugin that a huge population of users installed, and that they still ask about a decade after the author abandoned it.
But if you want suggestions
- start simple, with just reworking the âlook and feelâ, without trying to add the extra features like the live count
- redo your icon design: the industrial/bolted-plate design looks/feels nothing like anything else in Notepad++, so it doesnât seem like itâs part of the same app. Design some icons similar to the Fluent toolbar icons, and it would at least fit in with one of the existing GUI options.
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
