-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Current Behavior
When using Normal or RegEx expressions to "Find All" in current or all documents, one will end up with duplicated lines in the find results if the search text or expression appears 2 or more times in a line. I fully understand that this could be considered normal and expected as a matter of how the search mechanism works. However, for us regular human beings, we want to see only one line returned for each expression matched, even for lines that are matched multiple times.
Current Work-around
There are a few RegEx ways to return only one line. I provide one example here. The problem with these work-arounds is they nullify a nice feature of Notepad++ where Notepad++ highlights the text matched in the find results. The highlighting feature is nice because it draws my attention to the text I am searching for. But the RegEx work-arounds causes Notepad++ to either highlight much more text than what I am interested in (one method), or to highlight only the first matching text I search for in the line, not all of the matching text (another method which I show here).
Example work-around:
^.*?\Ktargetword (this returns only unique lines, but also only highlights the first occurrence of "targetword".
Desired Behavior for new feature
Ideally Notepad++ would have a check box for whether to return only unique lines. If unchecked, behavior is as it is now. But if checked, when Find All is used only unique lines are returned and every instance of the found text is highlighted, even if 2 or more instances of the text is found in a line. This desired feature would be available for both Normal and RegEx searches. Stated another way, Notepad++ would do the work of consolidating what would have been multiple lines into a unique line in the background on my behalf. This would be so much more intuitive than what we have today.
Thanks!