-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Description of the Issue
Notepad++ fails to jump to search hits initiated by "Find All in" (Current Document/All Opened Documents) searches for the first, new, unsaved document under certain conditions.
The two conditions:
- A saved document must be opened by NP++ at some point.
- A "Find All in" (Current Document/All Opened Documents) search for any search term must be initiated at some point.
After these two condtions are met:
- The first new, unsaved document that is created anytime after a saved document is opened in NP++ will be ignored by any double-clicking (jump to behavior) of search results for any subsequent "Find All in" (Current Document/All Opened Documents) searches.
Steps to Reproduce the Issue
- Open Notepad++ ensuring that there are no open documents other than the default "new 1".
- File > Open... "needles in the haystack.txt" and select "Open".
- Search > Find... "needle" (without quotes and Search Mode = Normal) and select "Find All in Current Document".
The Search results window will show a listing of 5 hits (1 file).
- Double-click any of the hits from the Search results window and NP++ jumps to the location of the result within the document. This is expected behavior.
- Edit > Select All (Ctrl+A) from the content of the "needles in the haystack.txt" document.
- Edit > Copy (Ctrl+C or Ctrl+INS).
- File > New (Ctrl+N). A new document tab, "new 1", appears.
- Edit > Paste (Ctrl+V or Shift+INS) into "new 1". Now the content from "needles in the haystack.txt" is duplicated into this new, unsaved document "new 1".
- With the Search results window still up, right-click and select "Clear all".
- Search > Find... "needle" (without quotes and Search Mode = Normal) and select "Find All in All Opened Documents".
The Search results window will show a listing of 10 hits (2 files).
- Double-click any of the hits from the Search results window and NP++ jumps to the location of the result within "needles in the haystack.txt" but double-clicking any of the hits from "new 1" will fail to even activate the view of the document and/or jump to the location. This is unexpected behavior.
Addendum:
If you repeat steps 7 and 8 several times for further new documents ("new 2", "new 3", "new 4") then proceed with steps 9 through 11. The behavior of jumping to the correct location works for all of the documents except for the first, new, unsaved document created after our opened document ("new 1" in our example).
Expected Behavior
Double-clicking any of the hits from the Search results window will result in NP++ jumping to the correct doucment and line of the search hit.
Actual Behavior
Double-clicking any of the hits from the Search results window will result in NP++ jumping to the correct doucment and line of the search hit with the exception of the first, new, unsaved document created after opening a saved document.
Debug Information
Notepad++ v8.5.2 (64-bit)
Build time : Apr 4 2023 - 19:55:32
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 7 Professional (64-bit)
OS Build : 7601.0
Current ANSI codepage : 1252
UPDATE: This bug seems to have been introduced in Notepad++ v8.5 as the last verison to exhibit expected behavior was in Notepad++ v8.4.9.