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, @coises,
Preamble :
What prompted me to suggest another solution is that you seemed really frustrated with how your plugin works, since you said, among other things :
What bothers me is that before you click the button, it’s not obvious what the current default scope will be
and also :
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.)
Even though I’ve been using Notepad++ for at least
15years, I’m just a former retired technician with some knowledge of Unix and Microsoft QBasic. So, if I took the liberty of suggesting another solution, it was solely because of your own dissatisfaction !Otherwise, I wouldn’t have written this post, since you’re surely better equipped to figure out how to improve your
Search++plugin !
That said, I’ll try to address some of your points. You said :
Dialogs are even more of an interruption than menus. It would also defeat the purpose of a docking dialog
Now that I think about it, I actually agree with you ! And, indeed, I forgot to consider the Docking dialog !
Now, regarding the mandatory buttons in this new dialog, we could, of course, add a
Define and Runbutton.Then, any of the four buttons
Define,Run,Define and RunandCancelwould close that new dialog and run the chosen action if you have clicked on theRunor on theDefine and Runbutton
Anyway, as you said, menus seem preferable. However, I still think that a layout with the six buttons Find, Count, Find All, Select, Mark and Show could be easier to use ( Personally, I’m ready to test a forked version, if you think it’s worth it )
This would simplify the number of menus :
-
The
Find,Count, andReplace Allmenus would stay unchanged -
I would suppress the last
Do not jump to next matchoption, in theReplacemenu as well as its sub-menu. To my mind, it’s rather a global way of searching which can be previously chosen in theToolsdialog with theJump to next match after Replaceoption (Ctrl + J)
Thus, a click on the
Replacebutton would just show this menu :------------------------------------------- Replace Replace backward ------------------------------------------- Replace in Selection Replace in Marked Text Replace in Whole Document ------------------------------------------- Replace Backward in Selection Replace Backward in Marked Text Replace Backward in Whole Documen -------------------------------------------- A click on the new
Find Allbutton would only show this menu :
------------------------------------------- Find All Find All in Open Documents Find All in Documents in this View ------------------------------------------- Find All in Selection ------------------------------------------- Find All in Marked Text Find All Before in Marked Text Find All After in Marked Text Find All in Marked Text in Open Documents Find All in Marked Text in this View ------------------------------------------- Find All in Whole Document Find All Before in Whole Document Find All After in Whole Document -------------------------------------------- A click on the
Markbutton would show this menu :
------------------------------------------- Mark Mark in Open Documents Mark in Documents in this View ------------------------------------------- Mark in Selection ------------------------------------------- Mark in Marked Text Mark Before in Marked Text Mark After in Marked Text Mark in Marked Text in Open Documents Mark in Marked Text in this View ------------------------------------------- Mark in Whole Document Mark Before in Whole Document Mark After in Whole Document -------------------------------------------- A click on the
Selectbutton would show this menu :
------------------------------------------- Select ------------------------------------------- Select in Selection ------------------------------------------- Select in Marked text Select Before in Marked text Select After in Marked text ------------------------------------------- Select in Whole Document Select Before in Whole Document Select After in Whole Document -------------------------------------------- A click on the
Showbutton would show this menu :
------------------------------------------- Show ------------------------------------------- Show in Selection ------------------------------------------- Show in Marked Text Show Before in Marked Text Show After in Marked Text ------------------------------------------- Show in Whole Document Show Before in Whole Document Show After in Whole Document -------------------------------------------
You said, at the end of your post :
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.
But, even though I unckecked, both, the
Default commands automatically search within selectionsand theDefault commands automatically search within marked textoptions and valid the new settings with theOKbutton, after selected some text containing ONLY one occurrence of the search, theCount in Selectionstill give1match only and not the totality of the matches of the current fileThen, using the
Add Selection to Marked Textoption to mark all the selection raange (Ctrl + M), again, theCount in Marked Textreturns1match, instead of the totality of the matches. Is this expected or a bug as the scope should beWhole Document?Best Regards,
guy038
-
-
Search++ version 0.7 is available:
-
Use different styles for Mark and Show. This helps keep Mark and Show cleanly separated, and it makes Always hide all lines and remove Show style from text before Show command behave more as one would expect with the default scope Show command, without introducing an inconsistency with the way other default scope commands behave.
-
Add several commands to the Tools menu, including support for the new Show style and more ability to manipulate Marked text. Some shortcuts have changed: most underlined menu characters and associated shortcut keys now match.
-
Expand visible on the Tools menu gives a rudimentary ability to show context for matches when using the Show command. Each expand visible action adds a line to the beginning and end of each visible block of text.
-
Add Find, Replace and Show tools to the main plugin menu. These commands are not very useful from the menu itself, but adding them makes it possible to set Notepad++ keyboard shortcuts for them.
-
Correct a fault in Show All Lines from the Tools menu that caused unexpected scrolling behavior. Improve the logic for vertical positioning when using Show All Lines.
Comments, criticisms, bug reports and questions as to what the hell I could have been thinking are, as always, most welcome.
The biggest change in this release is making Show more useful. Since Show no longer “marks” text but uses a different style to highlight matches, I expect the two concepts to interfere less. Show now uses a second indicator (matched to the color of the selected show style) so that it can, with some limitations, show zero length matches.
Previously, the setting Always hide all lines and remove Show style from text before Show command did what it was designed to do, but the design wasn’t very good, because leftover marks from a previous Show still affected the scope of a subsequent default Show command. Separating the mark and show styles fixes that, so the setting now causes Show commands to clear the results of any previous show, as one would expect.
Another thing that inhibited the use of Show was that you had to use both Remove marks from active document and Show all lines from the Tools menu to clear the results of a Show, and Show all lines had an annoying bug that screwed up vertical positioning after you used it. That bug is fixed, and a new command, Clear show (show all and clear style), resets the effect of Show all at once.
I expanded the Tools menu with several new commands; how useful they all are can only be discovered from experience.
The new Expand visible command on the Tools menu works with Show to make it possible to see a list of matches with some context: each time you click Expand visible (or use the Ctrl+P shortcut) each block of visible text is expanded to include the line before it and the line after it.
The addition of Find and Replace on the main plugin menu makes it possible to set shortcuts for the stepwise search commands. If you don’t typically use Alt+F and Alt+R to access the File and Run menus in Notepad++, you might try assigning those as shortcuts for Search++ Find and Replace and checking Settings | Focus the document after stepwise Find or Replace commands. The result is that you can use Alt+F or Alt+R to begin a search, have keyboard focus go immediately to the document, then continue to use the same key combinations to move through matches in the document. (This is somewhat like the behavior of F3 in Notepad++.)
-
-
But, even though I unckecked, both, the
Default commands automatically search within selectionsand theDefault commands automatically search within marked textoptions and valid the new settings with theOKbutton, after selected some text containing ONLY one occurrence of the search, theCount in Selectionstill give1match only and not the totality of the matches of the current fileThen, using the
Add Selection to Marked Textoption to mark all the selection raange (Ctrl + M), again, theCount in Marked Textreturns1match, instead of the totality of the matches. Is this expected or a bug as the scope should beWhole Document?The Default commands automatically… settings only affect commands with default scope. What happens when you uncheck one or both of those settings is that the commands with default scope:
Find
Find Backward
Count
Find All
Select
Mark
Show
Replace
Replace Backward
Replace All
pay no attention to whether there is a selection (if …within selections is unchecked) and/or marked text (if …within marked text is unchecked), and just search the whole document.Commands that specify a scope, like Count in Selection or Count in Marked Text, still do what their name says they do.
-
What prompted me to suggest another solution is that you seemed really frustrated with how your plugin works,
I do appreciate your suggestions, even if I don’t immediately adopt them as written. Anything you can tell me that sheds light on your experience with the interface and how it seems like it should work can help me find new solutions.
Anyway, as you said, menus seem preferable. However, I still think that a layout with the six buttons Find, Count, Find All, Select, Mark and Show could be easier to use ( Personally, I’m ready to test a forked version, if you think it’s worth it )
This would simplify the number of menus :
I can see how splitting the Find All button into four buttons (one each for Find All, Select, Mark and Show) would make the interface simpler, in that it would get rid of the need for sub-menus on those buttons. (And as you’ve pointed out, the [Do not] Jump to next match sub-menu on Replace isn’t really needed.) I’m not convinced yet, but it’s not out of the question, either.
My “default scope” (or “adaptive scope”) notion is a kind of extension of Notepad++’s Settings | Preferences | Searching | Minimum Size for Auto-Checking “In selection”. Since the docking version of the Search++ dialog might rarely if ever be closed and reopened during a session (I leave it open all the time), just choosing the setting when the dialog opens wouldn’t be much help: I wanted something that adapts to changing conditions, but that the user can still override when necessary. And I wanted it to handle selections and marked text similarly. It’s meant to make it so that usually you can just click a button and have it do what you would want it to do.
-
Hello, @coises,
You said :
What happens when you uncheck one or both of those settings is that the commands with default scope:
and :
Commands that specify a scope, like Count in Selection or Count in Marked Text, still do what their name says they do.
Thus, before downloading your new
Search++ version 0.7release, I ran a few more tests, and honestly, I was wrong about that. It’s kind of like I’m rediscovering the true concept of yourdefault scope!!So when, BOTH, the
Default commands automatically search within selectionsand theDefault commands automatically search within marked textoptions are unchecked, in Settings :-
The default
Findaction is identical to theFind in Whole documentaction -
The default
Countaction is identical to theCount in Whole documentaction -
The default
Find allaction is identical to theFind All in Whole Documentaction -
The default
Selectaction is identical to theSelect in Whole Documentaction -
The default
Markaction is identical to theMark in Whole Documentaction -
The default
Showaction is identical to theShow in Whole Documentaction -
The default
Replaceaction is identical to theReplace in Whole Documentaction -
The default
Replace allaction is identical to theReplace All in Whole Documentaction
Now, many thanks, @coises, for this new release ! Indeed, the
Showfeature has been completely redesigned and the addition of a separate style, different from theMarkfeature is a good improvement !However, I needed some time to understand what meant the option
Show selected lines (Shift: All) Ctrl + Q, in theToolsdialog ! Luckily, with theSearch++documentation, I understood the difference betweenCtrl + QandCtrl + Shift + QWould it be more simple to write the two lines :
Show selected lines Ctrl + Q Show all lines Ctrl + Shift + QInstead of that single line ( which sometimes seems wrongly labelled
Show all lines Ctrl + Q )?!
Your new
Expand visible Ctrl P, in theToolsmenu, is really a nice feature. I would suggest to label this optionShow one more line before and afteras this command can be repeated !BTW, do you plan to add, in the future, such a feature to the
Find Allfunctionality ?
Now, let’s say that I marked
15occurrences of some text. As I checked theBookmark lines when marking textoption, I got15blue marks. If I use your newInvert marked text, all non-marked text get marked and all marked text becomes unmarked : OKHowever, the bookmarks do NOT follow this new marked text. In addition, may be the option
Invert marked Lineswould be more interesting ! Or, possibly, the two options ?Best Regards,
guy038
-
-
It’s kind of like I’m rediscovering the true concept of your
default scope!!Your observations are correct. I think you get how it works now… which leaves me with the problem: How do I make this obvious to users who are not going to spend nearly as much time as you have spent to understand it?
Perhaps you see why I think it is useful: not having to constantly use a menu (or a dialog) for routine things like searching in a selection, or marking text and then finding or replacing within the marked text. Also, the Settings allow users to customize it to the way they work most often.
Yet, it loses its usefulness if it is a puzzle to know when it will do what, and you have to use the drop-down anyway because you aren’t sure what the default command will do. I’m still working toward finding a design that is efficient for power users, obvious for casual users, and predictable for everyone, while remaining visually appealing.
However, I needed some time to understand what meant the option
Show selected lines (Shift: All) Ctrl + Q, in theToolsdialog ! Luckily, with theSearch++documentation, I understood the difference betweenCtrl + QandCtrl + Shift + QWould it be more simple to write the two lines :
Show selected lines Ctrl + Q Show all lines Ctrl + Shift + QInstead of that single line ( which sometimes seems wrongly labelled
Show all lines Ctrl + Q )?!Without going into a lot of details, it comes down to economy of underlined letters for the menu options. (I’m reserving S, and the keyboard combination Ctrl+S, for save search.)
The menu option is labeled Show all lines when the selection (or caret if nothing is selected) occupies only lines that are already visible. In this case, there is no need to require Shift to show all lines, since showing selected lines would do nothing. It is labeled Show selected lines (Shift: all) when the selection includes text on a hidden line; then without Shift the command shows the selected line, but if you really wanted to show all lines, you can press Shift when you click to do that.
Mark selected text and Mark shown text have a similar dual function. If any text is already marked, they show (Shift: clear first) in the menu item. Using Shift clears existing marks first, while not using Shift adds to the existing marks.
All of these have keyboard accelerators using the same letter with and without the Shift key, which duplicate the functions of the menu commands.
Your new
Expand visible Ctrl P, in theToolsmenu, is really a nice feature. I would suggest to label this optionShow one more line before and afteras this command can be repeated !(It might seem silly, but running out of letters, I spent some time thinking of a way to use “p” before I came up with “Expand” for this option. “P” was one of the few letters that was unused in both upper and lower case as a keyboard accelerator, and I plan to add a (Shift: details) option, or something similar, allowing the user to do multiple lines at a time, or different numbers of lines before and after, or perhaps something else… I haven’t decided.)
BTW, do you plan to add, in the future, such a feature to the
Find Allfunctionality ?I hope to do that, but unlike Show, I expect that it will be necessary to specify the amount of context to be shown before and after each match before executing the Find All command.
Now, let’s say that I marked
15occurrences of some text. As I checked theBookmark lines when marking textoption, I got15blue marks. If I use your newInvert marked text, all non-marked text get marked and all marked text becomes unmarked : OKHowever, the bookmarks do NOT follow this new marked text. In addition, may be the option
Invert marked Lineswould be more interesting ! Or, possibly, the two options ?I’ve been a little uncertain how to handle bookmarks. I don’t generally use bookmarks in Notepad++ at all, so I don’t have much sense of how people use them.
I suppose that when Bookmark lines when marking text is checked, bookmarks should follow marks. But what if you already had some bookmarks, and then you added some more when marking text. Then you do something like Invert marked lines because you want to search for something in the remaining text — are you likely to accidentally lose bookmarks you set because you forgot to turn off Bookmark lines when marking text first? (Strictly speaking, you wouldn’t lose them, but they’d be mixed in with all the other previously unmarked lines, so in effect they would be lost.)
What do you think? My thought was that the reasonable use case for Invert marked text is to restrict a search to what wasn’t found in a previous search, and that carrying bookmarks along would be more likely to be an oversight than something you wanted to do.
-
Hi, @coises and All,
You said :
I’m still working toward finding a design that is efficient for power users, obvious for casual users, and predictable for everyone, while remaining visually appealing.
Good luck in the quest for this Holy Grail !!!
Now, is the following behavior a bug:
-
I previously checked the
Bookmark lines when marked textin theToolsmenu -
Then I do a simple selection of some lines of text
-
I use the
Mark selected textoption ( orCtrl + M)
=> Only the first line of the selection is bookmarked ( instead of each line of the selection ). It’s also the case if the file contains previous marked text and if I use the
Ctrl + Shift + Moption
You said :
(It might seem silly, but running out of letters, I spent some time thinking of a way to use “p” before I came up with “Expand” for this option. “P” was one of the few letters that was unused in both upper and lower case …
OK. So, perhaps you’ll agree with this new wording
Expand to one more line before and after, waiting for theShift(details)option. Allow me to proposeExpand to five lines before and after Ctrl + Shift + P. This would be a good compromise !
You said :
I’ve been a little uncertain how to handle bookmarks. I don’t generally use bookmarks in Notepad++ at all, so I don’t have much sense of how people use them.
Unlike you, I use bookmarks very OFTEN to isolate or delete portions of text. After marking some text, I mainly use the context menu by right-clicking within the bookmarks margin. For example :
-
I mark and bookmark sone lines of text for a specific occurrence. Then I copy all these lines and paste them in a new tab for further review
-
I mark and bookmark sone lines of text for a specific occurrence. Then I can either delete them or delete the non-bookmarked lines
-
I mark and bookmark sone lines of text for a specific occurrence. Then I cut them and paste all these bookmarked lines in an other location of the same file
-
After a sort, I mark and bookmark the duplicate lines of a file. Then I have two possibilities :
-
I delete all the bookmarked lines in order to keep only the unique lines
-
I invert the bookmarked lines and copy the unique lines in a new tab for further review
-
There’s just one option that I rarely use : the
Paste to (Replace) Bookmarked Lineswhich replaces each bookmarked line by the contents of the Clipboard !
There’s one thing that bothers me about your Invert marked text option :
- Let’s imagine the text, below, pasted in a new tab :
bla blah This is the test to do bla blah test bla blah-
Select the N++
Show All Charactersoption -
Mark, with
Search++, the two wordstest -
Now, use the option
Invert marked text:-
The first line of the file is wrongly bookmarked ( bug ? )
-
The two line-breaks, after each word
test, are also bookmarked
-
Compare by pasting the above text in a second tab, use the native N++
Markcommand and then theInvert Bookmarksoption of the Bookmark margin context menu ( In fact, anInvert Bookmarked Linesoption ).Thus, I think that you should add the
Invert bookmark linesoption, in theToolsdialog. Then :-
By using the
Invert bookmarked textoption, the results would be the SAME as they are now ! And the present bookmarks would remain as is. -
By using the
Invert bookmark lines Ctrl + Shift + L, the bookmarked lines would be inverted, but the marked text would remain as is, like with native N++ !
Best Regards,
guy038
-
-
Now, is the following behavior a bug:
-
I previously checked the
Bookmark lines when marked textin theToolsmenu -
Then I do a simple selection of some lines of text
-
I use the
Mark selected textoption ( orCtrl + M)
=> Only the first line of the selection is bookmarked ( instead of each line of the selection ). It’s also the case if the file contains previous marked text and if I use the
Ctrl + Shift + MoptionUnlike you, I use bookmarks very OFTEN to isolate or delete portions of text. After marking some text, I mainly use the context* menu by right-clicking within the bookmarks margin. For example :
-
I mark and bookmark sone lines of text for a specific occurrence. Then I copy all these lines and paste them in a new tab for further review
-
I mark and bookmark sone lines of text for a specific occurrence. Then I can either delete them or delete the non-bookmarked lines
-
I mark and bookmark sone lines of text for a specific occurrence. Then I cut them and paste all these bookmarked lines in an other location of the same file
-
After a sort, I mark and bookmark the duplicate lines of a file. Then I have two possibilities :
-
I delete all the bookmarked lines in order to keep only the unique lines
-
I invert the bookmarked lines and copy the unique lines in a new tab for further review
-
Thank you for these observations and clarifications. I see that I have misunderstood how bookmarks are used.
I had assumed the purpose of a bookmark was to make it possible to scroll quickly to locations you expect to want to find again (like putting a bookmark in a physical book). What you wrote tells me they are (also?) used as a way of marking whole lines to be processed differently from the remaining lines.
I added the Bookmark lines when marking text option when it was requested. (I think you requested it, and maybe someone else, too.) I see now that I didn’t implement that request correctly, or at least not the way Notepad++ does it. When marking matches that span multiple lines, Notepad++ puts a bookmark on every line involved in each match. In Search++, only the line where each match starts is bookmarked.
That came from my misunderstanding, thinking the only purpose of bookmarks was to find something easily. Since I thought that was how bookmarks were used, I kept the same idea when marking a selection: Search++ bookmarks only the first line (or the first line of each part of a multiple selection).
(Adding to the confusion, I forgot what was in my own code when I answered you about Invert marked text. I gave an explanation of why it doesn’t change bookmarks; but it does change bookmarks when Bookmark lines when marking text is checked. It clears all bookmarks and then puts a bookmark at the beginning of each contiguous span of marked text. That does exactly what I argued in my last post should not happen: it loses any individual bookmarks you might have set apart from those set by marking text.)
I will need to reconsider everything I do with bookmarks.
Some questions, not just for Guy but for anyone who uses bookmarks:
Is marking lines for processing, the way Guy describes, pretty much the only way people use bookmarks?
Or do you also (or instead) use bookmarks for navigation?
Is optimal behavior for the two uses different (e.g., bookmarking all lines that are part of a match, as Notepad++ does, versus marking only the beginning of a match, as Search++ does now)?
If you use “bookmark lines” when marking text (either in Notepad++ or Search++), is that a way of working in which you expect bookmarks to follow marked text? Or do you specifically want the search process to bookmark lines, but otherwise think of bookmarks and marked text as independent things?
-
-
Is marking lines for processing, the way Guy describes, pretty much the only way people use bookmarks?
Or do you also (or instead) use bookmarks for navigation?
Me personally, I almost never “bookmark” from the Mark dialog. I bookmark a line from the GUI (clicking in the margin) when I want to be able to navigate there when doing related edits in two or three different sections of code. But that’s my usage.
I know I’ve seen lots of posts here where people like using the bookmarks – especially across multiple lines – to make use of the Search > Bookmark > xxx Bookmarked Lines , and that’s often given as advice for some of the convoluted search needs that come up here.
So making sure it works under both use cases is probably a good idea.
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