"Find in files" window
Hello, two suggestions for the “Find in file” window:
- After the “find in files” ends, I’d like the search window to stay open and not to auto-close
- 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!
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.
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.