Hi, @coises and All,
Oh… My God ! I forgot about the Find All, Select, Mark and Show options, which do not have any scope, too !
So, in summary :
Regarding the scope :
If this 708adc69-d693-4e96-adb2-6f402ed45bb3-Blank.png icon appears, before the button label, the Default scope will be used
if this08af5243-714c-40bc-8247-510763ee0ee4-Whole.png icon appears, before the button label, the Whole Document scope will be used
if thisd59e1479-4b3c-462f-af67-4b7f62f508cd-Selection.png icon appears, before the button label, the in Selection scope will be used
If thisadfbc726-aabd-4792-ad31-cf7717bfb4bb-Marked.png icon appears, before the button label, the in Marked Text sope will be used
Regarding the extent :
If this d45fb46b-3b09-4456-8f7d-c0b66f8d8e29-Forward.png icon appears, after the button label, the Forward extent will be used
If this 85f4f540-205f-44af-abcc-bfef97c4232a-Backward.png icon appears, after the button label, the Backward extent will be used
If this e61141be-6358-49f8-b327-41a1681c65ab-Before.png icon appears, after the button label, the Before extent will be used
If this b6291bce-3c7a-4e17-99ff-993891b12555-After.png icon appears, after the button label, the After extent will be used
If this 5e4e9f32-93f4-4948-9ddf-212841685148-Any.png icon appears, after the button label, the Any extent will be used
If this6695d813-5478-48f3-aa0f-ca90d4036fd1-All.png icon appears, after the button label, the All Docs extent will be used
If thisi1aff38c1-7ee7-47f1-bedf-96dcb2936820-View.png con appears, after the button label, the Current View extent will be used
Regarding your question :
What do you want to do when you say Select and there’s already a selection, or you say Mark and there’s already marked text? Do you replace the existing selection or marks? add to them? or search within them?
To my mind, I would say :
Regarding Marked text
Add current marked text region(s) to existing one(s) and operate within the union of all these searched regions as Search++ does presently. If we don’t want to keep previous marked region(s), we can simply use one of the three Tools > Remove Marks from... options, firstRegarding selections :
That’s not the same story ! Indeed, for any command that does not delete the current selection(s), like Count in Selection, Find All in Selection , Select in Selection, Mark in Selection, Show in Selection, and Replace All in Selection : no problem. Thus :
Add current selection(s) to existing one(s) and operate within the union of all these selections as Search++ does presently. If we don’t want to keep previous selection(s), we can simply put the caret anywhere in current document, firstNote this tip regarding the Show command : after running your first Show in Selection option, you can use the Tools > Show all Lines option, to display all the document again, and then, add new selection(s) and, finally, run again the Show in Selection option !
Now, for any command that cancels all previous selection(s), like Find in Selection, Replace and Find in Selection and Find or Replace in Selection, they seem to act on the whole document anyway !
Strictly speaking, to handle this cas properly, you should keep a map of the beginning and end of EACH selection, in current document ! Probably not easy with huge documents and a nightmare because of all possible types of selection :-((
It’s worth noting that, within Notepad++, the In selection possibilities are restricted to these 5 actions :
The Count action
The Find All in current Document action
The Replace All action
The Mark All action
The Clear all marks action
BTW, why the choice between the Replace and Find... options and the Find or Replace... options is not placed in the Settings dialog, like within Notepad++ ? This would simplify some menus !
I understand, now, why the Mark in Whole document option returns 4 matches and the Mark in Marked Text option returns No matches found in marked text. Once any marked text exists, that means that any other operation will consider this marked text ONLY
Thus, as current document is the last change.log file and the current regex in Find dialog is (?si) 1.+?(?=^\R), the total amount of marked text is, indeed, the text below :
1. Regression fix: a crash in User Defined Language. 2. Regression fix: installing (or removing) plugin re-opens Notepad++ with permanent admin privilege. 3. Regression-fix: wrongly added parenthesis for some multi-bytes characters. 4. Regression-fix: incorrect function list text display for non-UTF8 documents. 5. Regression-fix: ProjectPanel Workspace text localization issue. 6. Regression-fix: Change History margin not enabled by default. 7. Regression-fix: Notepad++ update & plugin download fail behind corporate MITM proxies. 8. Security enhancement: Update cURL to v8.19.0 in auto-updater (WinGUp) to fix cURL security issue (CVE-2025-14819). 9. Improve performance by migrating the XML parser from TinyXML to pugixml. 10. Update Scintilla to 5.6.0 & Lexilla to 5.4.7. 11. Fix the issue where printing caused Notepad++ to crash. 12. Fix Find in Files failing to search file content on disk. 13. Add disableNppAutoUpdate.xml to disable auto-update when WinGUp (GUP.exe) is present. 14. Fix a memory leak on exit. 15. Fix installed auto-completion files not overwritten after update. 16. Add model capacity of shortcuts.xml & contexMenu.xml for administration. 17. Add an option to disable selected text drag-and-drop. 18. Fix wrong theme-writing path for non-ProgramFiles installations. 19. Enhancement: prevent XML config files from being overwritten when updating portable package (copy/paste). 20. Fix incomplete Find dialg tab translation when 1st opêned from Project Panels. 21. Fix Notepad++ spawning a new Windows Explorer process in Task Manager. 22. Add Function List & Autocompletion for D language. 1. Security enhancement: Make updater check interity & authenticity of server-returned XML (XMLDsig). 2. Security enhancement: Fix untrusted search path vulnerability (CVE-2026-25926) by launching explorer.exe. 3. Security enhancement: Make auto-updater (WinGUp) even more secured (Remove dll dependency & unscured options). 4. Fix a plugin installation crash due to incorrect processing catch. 5. Add redact selection feature - Default: █, Modifier (Shift + Click): ●. 6. Fix context menu shortcut localization not aligning to the right regression. 1. Fix EOL duplication regression when playing back old recorded macros. 2. Remedy search failure for pasted text containing trailing invisible EOL character. 3. Fix customized context menu regression where separator (id="0") escapes FolderName submenu. 4. Fix issue where a single undo reverted multiple changes after macro execution. 5. Fix visual glitch when dragging dockable dialogs on a 2nd monitor. 6. Fix inconsistent automatic search mode switching (RegEx to Extended) in Find dialog. 7. Fix incorrect URL parsing caused by Unicode special spaces. 8. Update to Boost 1.90.0. 9. Improve update themes feature: fix JavaScript.js edge case. 10. Update javascript.js to better match javascript (embedded) in all themes. 11. Function List: enhance for Perl & PHP; add for Nim. 12. Fix comments and highlighting in TCL. 13. Update perl keywords and autocomplete for 5.42. 14. Improvement: display Find dialog status message with invisible characters warning. 1. NppExport v0.4 2. Converter v4.7 3. Mime Tool v3.1And it’s easy to verify that the regex cannot produce any match as no empty line exists ( the look-ahead (?=^\R) ), in this text, to limit the search scope !
Now, @coises, we can trick your plugin by modifying the regex to search !! Here’s how, just for fun :
First, use the Tools > Remove marks from active document
Type in the regex (?si) 1.+?(?=^\R)|(?<=[.1]\r\n)\R in the Find dialog
You’ll note that , this time, we also search for any line-break if prececed with .\r\n or 1\r\n
Click on the ▼ of the Find All button
Choose the Mark option
=> Message Marked 8 matches ( So the previous 4 zones of text and the 4 line-breaks )
Now, change the present regex, in the Find dialog, by the regex (?si) 1.+?(?=^\R)
Click on the ▼ of the Count button
Run the Count in Marked Text option. Bingo : we do get the message 4 matches in marked text
-And, if we use the default Find button, it does matches, succcessivly, 4 bunches of text ;-))
Best Regards,
guy038