Community
    • Login

    Find previous doesn't work

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Steven123S
      Steven123
      last edited by

      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?

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Steven123
        last edited by

        @Steven123 ,

        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).

        1 Reply Last reply Reply Quote 2
        • Steven123S
          Steven123
          last edited by

          @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.

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn @Steven123
            last edited by

            @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 travelled

            which, if you try an older version of Notepad++ where backward searches were allowed, it does indeed produces different results.

            1 Reply Last reply Reply Quote 2
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors