Find previous doesn't work
-
I have a strange issue where “Find Previous” doesn’t work. Nothing happens when pressing the keyboard shortcut F4 or using the menu (Search > Find Previous). “Find Next” works just fine. Any ideas how to fix this?
-
If you are in Search Mode = Regular Expression, then find-previous does not work … by default. This is because regex don’t work as you expect them to in reverse direction.
If you would like to enable regular expression reverse search, you will have to edit a configuration file manually, as described at npp-user-manual.org
If this does not match your problem, you will have to describe things more fully (a screenshot of your Find dialog would go a long way toward that).
-
@PeterJones thanks, Search Mode = Regular Expression was the issue. Do you have an example of a regex that doesn’t behave as expected when searching in reverse? I have done it many times in other editors such as Vim and Sublime Text without encountering any issues.
-
@Steven123 said in Find previous doesn't work:
Do you have an example of a regex that doesn’t behave as expected when searching in reverse?
I did some research and it appears the logic for disabling the feature was that certain regex do not produce the same matches when moving forward through a series of different matches as is produced when moving backward through the same text.
It was deemed desirable from a user perspective to produce the same hits moving in either direction (otherwise users would put in bugs about this).
The example cited was this one:
find:
t\w+on this text:
to the test they travelledwhich, if you try an older version of Notepad++ where backward searches were allowed, it does indeed produces different results.
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