-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Issue Description
Logic executes to auto-set or auto-clear the In selection checkbox when the Replace window becomes the active window, depending upon the amount of selected text in the recently-active editor window. Because pressing Replace All on an inactive Replace window will activate the window, and then run the Replace All functionality, it is possible for the In selection checkbox to appear in one state to the user (at the moment of button press), but yet be in the opposite state when the Replace All is actually conducted.
Steps to Reproduce the Issue
- In Preferences > Searching set Minimum Size for Auto-Checking "In selection" to 6.
- Create a new Notepad++ tab with this text:
abcdefg
abcdefg
abcdefg- Select
athroughgon the line 1 and press Ctrl+h to invoke the Replace window. - Specify Find what of
c. - Specify Replace with of
Z. - Note that In selection is checkmarked (automatically, because 7 characters were selected when replace was invoked).
- Checkmark Wrap around and uncheckmark everything else (except In selection).
- Press the Replace All button.
- Observe (correct replacement):
abZdefg
abcdefg
abcdefg- Leave the Replace window open and move input focus back to the editor window.
- Select
bthroughdon line 2. - Without otherwise activating the Replace window, and noting that In selection is still checkmarked, press the Replace All button.
Actual behavior:
abZdefg
abZdefg
abZdefgLine 3 was changed.
Expected behavior:
abZdefg
abZdefg
abcdefgLine 3 should not have been changed and should still have a c in it.
Notes
This can also "go the other way", where the user sees an uncheckmarked In selection at the moment of Replace All press, and then observes that only the selected text affected by the replacement.
This is a restatement of #14624 which sort of "lost its way".
Workaround 1: In Settings menu > Preferences > Searching set Minimum Size for Auto-Checking "In selection" to 0.
or
Workaround 2: Activate Replace without clicking on an activatable control (e.g., click the Replace window's title bar, then alter In selection if needed, then finally press Replace All.
EDIT: It can also happen with the Mark All button as well, on the Mark window (edited title of issue to reflect this).
EDIT: It can also happen with the Count button as well, on the Find window (edited title of issue to reflect this).
EDIT: This seems to be a problem introduced by "solving" #14108.
Debug Information
Notepad++ v8.6.4 (64-bit)
Build time : Feb 20 2024 - 00:12:59
Path : C:\NotepadPlusPlus\Misc_NoBackup\Releases\npp.8.6.4\npp.8.6.4.portable.x64\notepad++.exe
Command Line : -multiInst
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 11 Pro (64-bit)
OS Version : 23H2
OS Build : 22631.3155
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4)