notepad-plus-plus icon indicating copy to clipboard operation
notepad-plus-plus copied to clipboard

[BUG] Search and Replace in files fail if filter contains space

Open NtuFlorimond opened this issue 11 months ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Description of the Issue

In the below example, I filter files with their full name : Transformation_Pt_Img_000_White to mireCH3Ar_11x11_pas7.yml Unfortunately, there are some space in this name and the search fails. With filter Transformation_Pt_Img_000_White*.yml , search is successful.

Image

Steps To Reproduce

  1. Create a basic file called "hello world.txt" in c:\temp
  2. Write "Earth" in it
  3. In Notepad++ , search for "earth" in files "hello world.txt" in C:\temp : there is no result
  4. Search for "earth" in file ""hello world.txt"" in C:\temp : there is no result
  5. Search for "earth" in files "hello*world.txt" in C:\temp : there is one result

Current Behavior

There is no hit in the Search panel

Expected Behavior

May be this behaviour is intuitive to peaople familiar with regular expressions

Debug Information

None 
Only the above scenario

Anything else?

No response

NtuFlorimond avatar Jun 05 '25 12:06 NtuFlorimond

I have a hard time calling the documented behavior of a progtram "a bug"

Image

You could use a ? in place of any spaces in your filter: so Transformation_Pt_Img_000_White?to?mireCH3Ar_11x11_pas7.yml

If you want this to be considered a "feature request", sure, that's reasonable. But I don't think it's a bug.

Would it have helped you if the (?) hover text had said "spaces are separators, and cannot be used as literal text in the filter" or something similar?

I filter files with their full name

If you are only searching one file, why use the Find in Files rather than opening the file and searching just that file?

Debug Information

None 
Only the above scenario

"Debug Information" means go to Notepad++'s ? menu, go to the Debug Info, and copy that from the dialog into the bug report or feature request, so that the Developer can know exactly what version of Notepad++ you are using, under what conditions, to help with the debugging of bugs or confirming old-vs-new behavior for feature requests. This is described in the template, where it clearly said,

Image

pryrt avatar Jun 05 '25 21:06 pryrt