Community
    • Login

    "Find in files" window

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 2.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.
    • niente0N
      niente0
      last edited by

      Hello, two suggestions for the “Find in file” window:

      1. After the “find in files” ends, I’d like the search window to stay open and not to auto-close
      2. This is a little more complex to explain, I’ll try with an example:
      • I search for “hello” in files
      • I find 4 occurrences of “hello” in one file
      • I double-click on the first result, Notepad++ correctly opens the file and highlights the first occurrence in the text
      • I manually change the word “hello” with “goodbye” (2 chars longer)
      • I double-click on the second occurrence to do the same thing
      • Notepad++ highlights the wrong characters because, after my edit, the text shifted ahead by 2 chars, I expected Notepad++ to update positions of all string occurrences after my manual edit, instead it selects a wrong string!

      Thanks!

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @niente0
        last edited by

        @niente0

        Don’t really understand your number 1, unless you just want it to stay open so that you don’t have to open it again to do the next search.

        For number 2, this is a long-known “issue”, but I hesitate to call it an issue since you have changed the text since the search was done. What I do in such a circumstance is start changing the text at the bottom-most match first, then work my way up towards the top of the file. This works because the remembered offsets of matches nearer the top of the file haven’t been changed by any editing lower down near the bottom of the file.

        1 Reply Last reply Reply Quote 0
        • niente0N
          niente0
          last edited by

          Thank you for your answers!

          For number 1, I’d just like the ‘find in file’ window to behave like it does when using a simple search (stay open until I close it). I do many consecutive searches into files (for example to count occurrences of a series of words), and I have to reopen the search window every time. It’s quite annoying, it would be useful for me to have an option in settings to disable auto-close.

          For number 2, the workaround you suggest (bottom-up editing) works perfectly, I posted this request just for a possible future implementation (actual behaviour is useless because results become invalid after an edit). It’s just a matter of actual behaviour vs expected behaviour.

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