Search++: A work in progress
-
Thank you for all your time looking at this and processing my rambling ideas. A couple answers to this part:
I suppose it would be worth to add, in the documentation, that, after pressing the
▼key, at the rightmost part of theSearch++dialog , before the options :-
Hitting the
Fkey runs the defaultFind Alloperation -
Hitting the
Skey runs the defaultSelectionoperation -
Hitting the
Mkey runs the defaultMarkoperation -
Hitting the
Hkey runs the defaultShowoperation
Noted. I can add more details about keyboard navigation. The big problem, though, is that there is no straightforward way to navigate to that down arrow menu (or any of the other split button menus) by keyboard. And I still haven’t thought of a good way to make it work.
Regarding the general problem about focusing within the plugin dialog or within the current document, I don’t bother about it.
Good to know that what I have so far is comprehensible and working as intended. The default for Focus the document after stepwise Find and Replace commands is unchecked, which as you explain is likely to be less confusing than checked.
You said, in the first of of last three consecutive pôsts :
For multiple document searches, the completion message (e.g., “Found 12 matches in 7 of 9 open documents.” or “No matches found in 5 open documents.”) could include that some (or all) documents were skipped because the find string includes characters inconsistent with the documents’ encoding. Something similar could be added to Find in Files.
I agree to add these messages which give extra inormation on the current search !
Noted. I will probably attempt it only for Plain text searches first, as it is easier for plain text. (No need to figure out which characters it can’t match without: it needs all of them!)
On the other hand, in your previous loooong post, you said :
3-4 Would it be better to show it on the buttons and remove the ability to select an action with other than default scope as the action for a button by shift-clicking the drop-down menu? Does anyone even realize they can shift-click the drop-down menus (the only way to know is to do it by accident or read the help)?
And I answered :
Personally, I’m rather in favor of your last point. That way, we would know exactly which operation has just been performed, and it would be really helpful when pressing the Search button , at the rightmost zone of the Search++ panel — which would clearly indicate whether we’ve selected and run : a list, a selection, a mark, or just the results of a search !
I do know about using the
Shiftkey and aclickon any drop-dwon menu. However, what is your general feeling about my reply : any operation would be clearly identified and affecting a default option would not been anymore mandatory ?!I have a feeling we are not communicating on this one. I can’t quite figure out what you mean, and I suspect what I wrote didn’t convey what I intended. I’ll address this in a separate post.
You also said in the same post :
4 Figure out how to modify Boost.regex to get rid of the dreaded “complexity” message. Make progress responsive during a search (not just between finds, as it is now: Boost.regex as built has no progress callback, so you can only estimate progress after it succeeds or fails to find a match, not while it’s working) and let the user cancel if it’s taking too long.
And I answered :
I do not think this point is essential. Check out my post at https://community.notepad-plus-plus.org/post/106252. Apparently, for certain regular expression searches, this specific message, about complexity, may appear (even though the result is correct) when the scanned file contains an average number of lines, with nice results for smaller files and an error for big files !
Did you already tried to test the regex proposed in that post and did you deduce some facts ? I didn’t even think it was possible to get a correct result while seeing a message telling you that the current search is incorrect !!
It isn’t possible without changing Boost.regex. The code for Boost.regex is open source. What I’m considering would amount to “forking it” to change two things:
-
The complexity message occurs when a heuristic in the Boost.regex code estimates that “too much” text is being reexamined while “too little” progress is being made in moving the initial match point forward. It is important to understand that this is not testing for something like memory exhaustion which would crash the program, it’s merely making a guess as to whether the supplied regular expression is one that will never complete (or will take a ridiculously long time). I would want to remove that test entirely and let the user decide when it’s taking too long and making too little progress.
-
Boost.regex needs that because it has no means of reporting progress or canceling searching before it either finds the next match or finds that there are no more matches. So if you’re searching a large file for something that is near the end, Boost.regex doesn’t let you visualize how the search is proceeding. (The only time we see progress is as each one of multiple matches is found.) There is also no clean way to cancel a search for the next match until it either succeeds or fails. I would want to add a callback that would let the calling program monitor progress and cancel at user request.
I listed this because it’s one of my eventual goals, but I do wonder whether people care much. I haven’t tried to do it yet. My plan is to get to a “1.0” version of Search++ before I work on that. There are a couple other things that would probably involve modifying Boost.regex code (Unicode word boundaries and more complete implementation of Unicode properties) which I also am considering, but will likely not attempt until after a 1.0 version.
-
-
Hello, @coises,
Regarding this specific point :
3-4 Would it be better to show it on the buttons and remove the ability to select an action with other than default scope as the action for a button by shift-clicking the drop-down menu? Does anyone even realize they can shift-click the drop-down menus (the only way to know is to do it by accident or read the help)?
May be I expressed my choice very badly ! Actually, I just wanted to say that the changes in the appearance of the various buttons ( Find, Count, Find All, Replace, Replace All )— which occur when you hold down the
Shiftkey while clicking a button — would be visible immediately, in future releases, just by selecting the desired option, without needing to hold down theShiftkey. Does this wording make more sense to you ?BR
guy038
-
@guy038 said:
Regarding this specific point :3-4 Would it be better to show it on the buttons and remove the ability to select an action with other than default scope as the action for a button by shift-clicking the drop-down menu? Does anyone even realize they can shift-click the drop-down menus (the only way to know is to do it by accident or read the help)?
May be I expressed my choice very badly ! Actually, I just wanted to say that the changes in the appearance of the various buttons ( Find, Count, Find All, Replace, Replace All )— which occur when you hold down the
Shiftkey while clicking a button — would be visible immediately, in future releases, just by selecting the desired option, without needing to hold down theShiftkey. Does this wording make more sense to you ?I see. I think I follow what you’re suggesting, but I have to admit I don’t like it. I don’t think selecting a function from the drop-down should always make that the new one-click action for the button.
However… it could be an option. Enabling a setting like Buttons automatically change to last drop-down action would reverse the meaning of the Shift key, so that when you click an action in the drop-down menu it becomes the new action on the button, and you have to Shift+click if you don’t want that to happen.
Is that what you mean? Seems like a good idea. Thanks.
-
Hi, @coises,
Yes, I suppose that a new option could be a nice solution. However, could you mention the
SHIFTkey in this option : something like, for example :□ Buttons reflect last drop-down action, without SHIFT key
So :
-
If this option is enabled, a simple click would change the appearance of buttons and
Shift+ click would keep their appearance unchanged -
If this option is disabled, a
Shift+ click would change the appearance of buttons and a simple click would keep their appearance unchanged
BR
guy038
-
-
I had written:
In the main search dialog, when the default action is active for a button (e.g., Find, Count, etc. without a scope qualification like “in Selection” or “in Marked Text”), somehow indicate what the default action would be if you pressed the button right now. That is, Find adapts to work in selection if you have a selection large enough, or in marked text, or in the whole document, but what will it actually do right now? This feels like a big missing thing to me, but I’m a bit stumped as to how to indicate it.
- If a put a general indicator somewhere (it will always be the same for all buttons with default scope), where, and how should it appear? I am very hesitant to take up additional space in the dialog, or to make it any more “busy” than it already is.
- If I show it on each button, how would I distinguish it from the marker that tells you the direct action for the button is a command with a specified scope? (Remember, this has to work for any dark mode color combination the user might pick, and some users are colorblind.)
- Would it be better to show it on the buttons and remove the ability to select an action with other than default scope as the action for a button by shift-clicking the drop-down menu? Does anyone even realize they can shift-click the drop-down menus (the only way to know is to do it by accident or read the help)?
@guy038 wrote:
Personally, I’m rather in favor of your last point. That way, we would know exactly which operation has just been performed, and it would be really helpful when pressing the Search button , at the rightmost zone of the Search++ panel — which would clearly indicate whether we’ve selected and run : a list, a selection, a mark, or just the results of a search !
I do know about using the
Shiftkey and aclickon any drop-dwon menu. However, what is your general feeling about my reply : any operation would be clearly identified and affecting a default option would not been anymore mandatory ?!While I was writing this, you clarified what you meant, and I responded to that.
What I was attempting to describe is related to the problem you encountered when you did a default Show search and nothing happened. The reason was because the previous Show caused text to be marked, so when you did a new default Show, it was searching within the marked text, though you meant to search the whole document. That’s what “default scope” does: it might search selected text, it might search marked text, or it might search the whole document, depending on your settings and whether text is marked, or enough text is selected, at the time.
What bothers me is that before you click the button, it’s not obvious what the current default scope will be. Maybe you forgot you had text marked. Maybe you thought your selection was over the minimums you had set in Single selections must have at least:, but it was actually a couple characters short. You could still do what you meant to do by selecting from the drop-down menu, but you might not realize that you need to use the drop-down; then you’re left puzzled by why the results were not what you expected.
I’ve hit this trap myself, and I wrote the damn thing!
One possibility is that my “default scope” concept is just fundamentally flawed. Maybe the user should have to indicate, each time, whether the intent is to search the whole document, search in selected text or search in marked text. Yet I fear adding that many buttons, or using some fancy, non-standard divided buttons, would make an overly busy and confusing interface; while using modifier keys or having to use the drop-downs for everything but whole document searches would be clumsy and annoying. So I’m trying to think how I can give a visual cue as to what the “default scope” is before you click the button; that way, if it isn’t what you expected, you’ll know to use the drop-down instead (or change your selections or marks).
The problem then becomes, if I add a scope indicator that changes with conditions, how do I do it?
The first idea I listed was a bad one. A common indicator would be in the wrong place (that is, not where you’re looking when you go to click a button), and I was wrong about it always being the same, since the unchecked states of Allow default Select command to Select in Selection and Allow default Mark command to Mark in Marked Text exclude certain scopes from those commands only.
The second idea makes more sense: put the indicator on each button, letting it change as conditions change. The problem is, how would I distinguish that from the scope indicators that appear if you Shift+click the drop-down menu and select a command that does not use default scope (like “Find All in Whole Document”)? You wouldn’t (easily) know when you had selected a command with fixed scope and when you had a default scope command, except by noticing whether it ever changes when you select or mark text.
The third idea questions whether being able to set a non-default scope command as the one-click command for a button is worthwhile at all. If you can never do that, then there is no problem with confusing the meaning of the scope indicator on a button: it would always mean that is the current scope of the default scope command, since other commands could not be assigned as the one-click action for a button.
I don’t like any of my ideas. (For that matter, I don’t like my scope and extent icons, either. The arrows are OK, but as for the rest, I tried everything I could come up with and I still think they’re obscure, confusing, ugly and hard to read.)
So I guess I was hoping someone might come up with an idea I like better than my own. Or say something that would lead to me coming up with a better idea than the ones I’ve had so far.
-
C Coises referenced this topic on
-
Regarding the features under consideration :
You said :
- Context in search results: that is, showing one or more lines before or after the line(s) containing a match.
- This would be optional and configurable, but a tricky question is whether it is sufficient to configure it before the search or whether you should be able to request context — either for a specific match or for all matches — directly in the search results window, after the search.
Personally, I suppose that asking for 1 to 5 lines before / after the context, once the search ended, should be sufficient !
Making sure we understand each other precisely is important here.
Implementing context is not quite as simple as it sounds, but for Find All commands that create a search results list, it is much trickier if the context can be requested after the search is complete, rather than specified before the search is performed.
I do understand that it would be handy to look at search results and then say, “Oh, I need some context. Expand this to show me two lines before and three lines after each match.” It’s a lot more complicated to implement that than to have the user specify context requirements beforehand (e.g., a setting that says, “When I search, show me two lines before and three lines after each match”) and include those lines in the search results.
I’m not saying it’s impossible; just enough more complicated that it’s worth understanding how badly it’s wanted or needed before trying to do it.
If I implement requesting context after the search, should it be for an individual match (“show me two lines before and three lines after this match”), for all matches, or are both options needed?
You said
It seems like it would make sense for this to be available for Show actions, too.
Yes it would. I agree with your opinion !
The next release will include something vaguely like this: the ability to “expand” visible blocks (such as those resulting from Show) by showing one additional line before and after each. This can be repeated to show more lines as desired. It doesn’t give find-grained control, but it keeps things relatively simple, and it may prove to be good enough.
-
Hello, @coises and All,
As for the two points you mentioned in your last post, I now realize that I should have given them more thought : in fact, it is, of course, much easier to agree — before conducting the search — on the number of context lines to add on either side of the lines containing the occurrence(s).
Thus, forget my initial proposition. I suppose that the context lines feature should be decided before the search ! Anyway, do as you like :
-
If you think you’ll be able to manage an AFTER search context lines feature easily enough, without leading to other problems, just go ahead !
-
If you think the BEFORE search solution would be safer and more simple, just prefer it !
As for the number of context lines needed, a general amount of
Nlines, both before and after, with1 to 5 maxshould be enough !
Now, I’d like to add a general point :
Do not worry too much about what I personally think. Other users may have different opinions. After all, the
Search++plugin is your brainchild, and you should plan its structure and improvements however you see fit !Personally, I prefer programs with a few well-implemented features to programs with a plethora of poorly managed features !
Best Regards,
guy038
-
-
Hello, @coises,
Regarding my post, I admit that the concept of a word is rather difficult to grasp. On that note, this is developed in the Martin Haspelmath’s article, published in June 2010, which highlights this point :
Follow this link https://zenodo.org/records/225844 to see the
PDFfile or use https://zenodo.org/records/225844/files/WordSegmentaionFL.pdf to download it !Here are a few excerpts of his publication : :
At end of section 5, it is said : … On such a view, the claim that all languages have words (Radford et al. 1999: 145) would be interpretable only in the weaker sense that “all languages have a unit which falls between the minimal sign and the phrase” …
And : … The basic problem remains the same: The units are defined in a language-specific way and cannot be equated across languages, and there is no reason to give special status to a unit called “word”'. …
At beginning of section, 7 : … Linguists have “no good basis for identifying words across languages” …
And in the conclusion, section 10 : … I conclude, from the arguments presented in this article, that there is “no definition of word” that can be applied to any language and that would yield consistent results that are in accord with our writing habits.
Thus, let’s accept that our different regex engines give us an approximate count of the
Wordscharacters set !
Note that, on the contrary, the definition of Non-space characters is quite strict, since the
Spacecharacters set, that delimit them, consist of only25Unicode characters !BR
guy038
-
This post is deleted! -
Hello, @coises and All,
Presently, I think we can summarize how your plugin works, using the table, below, on its left part :
•=========================•=======================•============================================• •===============•============================== | Actions | Scopes | Extents | | Actions | Default configuration •=========================•=======================•============================================• •===============•============================== | | | | | | | Count | In Selection | N/A | | Find | | ¯¯¯¯¯ | | | | | | •-----------------------•--------------------------------------------• •---------------•------------------------------ | | | | | | | Find All | | Before Caret | | Count | | ¯¯¯¯¯¯¯¯ | | | | | | | In Marked Test | After Caret | •---------------•------------------------------ | | | | | | | Mark | | Everywhere | | Find All | | | | | | | | | In Whole Document | In All Opened Documents | •---------------•------------------------------ | | | | | | | Replace All | | In All Opened Documents of Current View | | Select | | ¯¯¯¯¯¯¯¯¯¯¯ | | | | | •-------------------------•-----------------------•--------------------------------------------• •---------------•------------------------------ | | | | | | | | In Selection | N/A | | Mark | | | | | | | | Select •-----------------------•--------------------------------------------• •---------------•------------------------------ | | | | | | | | In Marked Text | Before Caret | | Show | | | | | | | | | | After Caret | •---------------•------------------------------ | Show | | | | | | | In Whole Document | Everywhere | | Replace | | | | | | | •-------------------------•-----------------------•--------------------------------------------• •---------------•------------------------------ | | | | | | | Find | In Selection | | | Replace All | | ¯¯¯¯ | | Backward ( if Plain text ) | | | | | In Marked Text | | •===============•============================== | | | | | Replace | In Whole Document | Forward | | ¯¯¯¯¯¯¯ | | | •=========================•=======================•============================================•The underlined actions are those which have a button, by default
Personally, your concept of a default scope bothers me a little, because it’s hard for me to know, in advance, which actions will be automatically selected by the plugin !
So, I was thinking about a radically different layout :
-
You entirely suppress the
default scopefunctionality. However, I suppose this will affect the Selection section in the settings ! -
You does not show any symbol on all the buttons, nor use any
drop-downlist -
You just show six one-letter buttons and two one-letter button for the replace actions, as below :
|F| |C| |A| |S| |M| |H| : Find Count find All Select Mark sHow |R| |A| Replace replace All-
All these simple-design buttons would open a common dialog box, in which the selected action — one of the eight possible options — would be already selected by default. This dialogue could be based on the table shown above !
-
Then, you’ll just have to check your present
scopeandextentchoices for the chosen action -
Optionally a message, summarizing everything that has just been selected, could be displayed
-
Then, this new dialog would end with three buttons :
-
A
Definebutton to attribute a default configuration ( scope and extent ) for the chosen action, without any execution. -
A
Runbutton to start the chosen action, without any default configuration to apply to -
And, of course, a
Cancelbutton, or an hit on theESCkey, to dismiss the chosen action
-
IMPORTANT :
As we must distinguish a default configuration ( the set of the
3elements : action, scope and extent ) from the execution of a simple action with ramdom scope and extent, theDefinebutton, introduced above, must record that default configuration, within this dialog.So, when clicking on the
Definebutton, the default configuration, to write in this new dialog, would be :For the
Count,Find All,MarkandReplace Allactions, one of these11messagesCount / Find All / Mark / Replace All in Selection Count / Find All / Mark / Replace All in Marked text Count / Find All / Mark / Replace All Before in Marked text Count / Find All / Mark / Replace All After in Marked text Count / Find All / Mark / Replace All in Marked Text in Open Documents Count / Find All / Mark / Replace All in Marked Text in Documents in this View Count / Find All / Mark / Replace All in Whole Document Count / Find All / Mark / Replace All Before in Whole Document Count / Find All / Mark / Replace All After in Whole Document Count / Find All / Mark / Replace All in Open Documents Count / Find All / Mark / Replace All in Documents in this ViewFor the
SelectandShowactions, one of these7messages :Select / Show in Selection Select / Show in Marked text Select / Show Before in Marked text Select / Show After in Marked text Select / Show in Whole Document Select / Show Before in Whole Document Select / Show After in Whole DocumentFor the
FindandReplaceactions, one of these6messages :Find / Replace Forward in Selection Find / Replace Forward in Marked Text Find / Replace Forward in Whole Document Find / Replace Backward in Selection Find / Replace Backward in Marked Text Find / Replace Backward in Whole Document
Notes :
-
Of course, you could, in one go, click first on the
Definebutton, then click on theRunbutton -
A simple click on any of these eight buttons, would allow to quickly verify their default configurations, as long as you press the
Cancelbutton, right after !
In other words, no more drop-down menus ! Instead, a new configuration dialog to confirm the default scope and extent values of the chosen action AND / OR the execution of the chosen action, with the present options checked in the scope and extent sections
There are surely some drawbacks to my proposal ! Anyway, what’s your feeling about this radical change ?
Best Regards,
guy038
-
-
Personally, your concept of a default scope bothers me a little, because it’s hard for me to know, in advance, which actions will be automatically selected by the plugin !
(It occurs to me that perhaps I should call it “adaptive” rather than “default” scope. Within the program code I called it “Smart,” but by the time I got the help and UI together I decided that word sounded too pretentious.)
The uncertainty about what action a button will perform bothers me, too. I’m still trying to think of a way to mitigate that. I think the idea of an adaptive scope is useful, but I don’t like that you can’t confirm what actual command a button with adaptive (default) scope will perform at a glance, before clicking it.
- You just show six one-letter buttons and two one-letter button for the replace actions, as below :
|F| |C| |A| |S| |M| |H| : Find Count find All Select Mark sHow |R| |A| Replace replace All-
All these simple-design buttons would open a common dialog box, in which the selected action — one of the eight possible options — would be already selected by default. This dialogue could be based on the table shown above !
-
Then, you’ll just have to check your present
scopeandextentchoices for the chosen action -
Optionally a message, summarizing everything that has just been selected, could be displayed
-
Then, this new dialog would end with three buttons :
-
A
Definebutton to attribute a default configuration ( scope and extent ) for the chosen action, without any execution. -
A
Runbutton to start the chosen action, without any default configuration to apply to -
And, of course, a
Cancelbutton, or an hit on theESCkey, to dismiss the chosen action
-
In other words, no more drop-down menus ! Instead, a new configuration dialog to confirm the default scope and extent values of the chosen action AND / OR the execution of the chosen action, with the present options checked in the scope and extent sections
There are surely some drawbacks to my proposal ! Anyway, what’s your feeling about this radical change ?
At first I thought you meant every single action would require clicking a button, looking at a dialog to verify the options are what you want, then clicking a button in the dialog to actually do the action. What is now Find, Find, Find would become F, dialog opens, check defaults (change them if wrong and Define), Run, F, dialog opens, Run, F, dialog opens, Run. That would be way too much interruption of flow for a user doing simple things.
- Of course, you could, in one go, click first on the Define button, then click on the Run button
Since this implies that Define does not close the dialog, perhaps you also intend that Run does not close the dialog. That would allow for repetitive actions, at the expense of having this dialog (in addition to the main Search++ dialog) on the screen while doing them, and having to click another button to close it after the last or only action.
I’m sorry, but it sounds to me as if it would be very clumsy to use. Dialogs are even more of an interruption than menus. It would also defeat the purpose of a docking dialog if another dialog has to be raised to actually do anything… unless it is also docking…
In my opinion, the main buttons must do something that’s usually useful with a single click. To what degree that should be “adaptive” (e.g., in selection when there is a “large enough” selection) is debatable: adaptation increases the chance that you can do what you want with a single click, but also increases the chance that what a single click does won’t be what you expected.
I think six buttons under the find box would be too busy, making it harder for the user to immediately identify and click the desired button. A busy layout doesn’t bother me as much with something like the Settings dialog (which, I admit, is horrible) that you don’t open often, but for something that’s meant to be used frequently, maybe even kept open in a docking panel, visual simplicity is important.
For what it’s worth, you can get some aspects of your idea now. Just use Shift+click on each drop-down menu to choose a command that does not use default scope as the command for the button. Click the button when you want to Run what you already have set. If you want to Run a different command, select it from the drop-down. If you want to Define and Run a different command, Shift+click it in the drop-down. (There is no equivalent to Define without Run.)
Additionally, in the Settings dialog you can uncheck Default commands automatically search within selections. and Default commands automatically search within marked text. to disable the adaptive mechanism, so that default scope is always Whole Document and even if you select a plain command (Find, Count, etc.) Search++ will never infer anything other than Whole Document.
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