@guy038 said in Search++: A work in progress:
Let’s hide all the contents of a file 1, with the option in the Tools panel
Switch to an other file 2
Switch back to file 1
All the lines of file 1 are visible again : I suppose that this behaviour is the one that you expect, don’t you ?
@guy038, thank you so much for all your thoughts and your tests. They are an immense help.
I see there is a potential problem here, without a simple solution. It looks like Notepad++ saves and restores hidden lines, but it tracks them when it hides them or shows them, so it is unaware of any changes in state made by a plugin. It not only doesn’t restore lines hidden in Search++, if you hide lines in Notepad++ and then find them in Search++, they wind up hidden again when you switch tabs away and back.
Ugh. This could be really messy. :-(
Let’s mark some text with the native N++ Mark dialog with the Bookmark line option checked
If you use the Unmark All Text option of the Tools panel, it correctly clear all the marks. However, it does not clear the associated bookmarks !
I think of two possible solutions :
Clear all the bookmarks, as well
Add a new Clear bookmarks option
Unless it doesn’t work for some reason (I haven’t tried it yet), I think Notepad++’s own Search | Bookmark | Clear all bookmarks can handle that.
May be, @coises,I just did not exactly understand the Selection concept ?
It sounds like I need to clarify what happens a little more in the help. Short answer: the first Find selects the text it found, which wipes out the original selection; it’s not possible to search within a selection that doesn’t exist, so subsequent searches revert to searching the whole document.
This traces back to some discussion about search in early Columns++. The purpose of having a search function there was to make it possible to search and replace in column selections, which Notepad++ search will not do. @Alan-Kilborn observed some unexpected behavior and suggested using what Scintilla calls an indicator. (Notepad++ calls it marked text or a style… both style and mark mean something different from indicator in Scintilla, so keeping the words straight is an ongoing challenge.)
The fundamental operation of Find (step-wise) is to select what was found. You can’t have a selection within a selection; the original selection is lost when you do the first Find. My original attempt at solving this in Columns++ — by “memorizing” the original selection and using it for subsequent finds — did not work well. After Alan’s suggestion, I switched to “Search in Indicated Region” and set a marked region from the column selection. Eventually I wound up with some features for controlling the indicated region incorporated into the search dialog, and some complicated rules (described here under the heading “Other controls in the Search dialog”) to make it so that users can almost forget about the indicator, even though every search in Columns++ must happen within an indicated region.
One of my goals in Search++ was/is to get rid of the imposition of an “indicated region” (now just called “marked text”) on users who aren’t thinking in those terms.
The rough equivalent to Selection -> Region | Auto set in Columns++ (which is checked by default) is Settings | Convert selections to marked text before beginning a stepwise search in Search++ (which is not, at present, checked by default).
Given my experience with Columns++, I don’t plan to attempt to restrict search to a “memorized” selection that no longer exists. Either you convert the selection to marked text, let Search++ convert it for you, or only the first step-wise Find will be confined to the original selection.