FIXED: Search in Files with a newline gives strange results

Report issues, odd behaviors or submit a detailed bug report.
Post Reply
User avatar
primehalo
Posts: 136
Joined: 16 Jun 2011 03:10
Contact:

FIXED: Search in Files with a newline gives strange results

Post by primehalo » 03 Jun 2017 02:54

I'm currently using v12.11 but this a bug I've encountered a few times before in previous versions.

I do a search across a folder which contains a lot of files. If my search text is just a single line with no newlines then it correctly finds all instances and lists those files in the search results pane. In the most recent case there were 432 items found in 432 of 893 searched files. If I add the new line onto my search text, it then only finds the text in files that happen to be opened in the editor (I still have it set to search in a folder, including subfolders). The other times this happened I thought that perhaps the other files had different line encodings. This is the first time I actually tried to figure out what was going on.

I had one of the files opened so that I could copy the line of text I wanted to find. I copy the text (including the newline), paste it into the "Edit find text..." popup, and search. The only result I got was the file that I had opened. I opened another file in the same directory which had that same line of text in order to see if maybe the line endings were different, but they weren't. Both files are Unix/Linux/Mac OSX. I then did the search again and it found those two files. I opened a third file and searched and it found those three files. I closed the two files I just opened and searched again, and it only found the one file that was currently opened. I tried opening a file in a different subdirectory and searched, and it only found the two files that were opened. I closed all the files and search and it finds none. All of these UTF-8 .htm files without BOM and with Unix/Linux/Mac OSX line endings.

User avatar
Rickard Johansson
Site Admin
Posts: 5345
Joined: 19 Jul 2006 14:29

Re: Search in Files with a newline gives strange results

Post by Rickard Johansson » 06 Jun 2017 11:38

I've tried to reproduce it. but no luck. Could you post a screenshot of the search options?

User avatar
primehalo
Posts: 136
Joined: 16 Jun 2011 03:10
Contact:

Re: Search in Files with a newline gives strange results

Post by primehalo » 06 Jun 2017 22:05

I've attached a screenshot of my search options
Attachments
RJ TextEd Search Settings.png
RJ TextEd Search Settings.png (27.94 KiB) Viewed 1922 times

User avatar
Rickard Johansson
Site Admin
Posts: 5345
Joined: 19 Jul 2006 14:29

Re: Search in Files with a newline gives strange results

Post by Rickard Johansson » 07 Jun 2017 11:37

Thanks, but I meant the options in the search bar/dialog window.
_Find.png
_Find.png (131.97 KiB) Viewed 1893 times

User avatar
primehalo
Posts: 136
Joined: 16 Jun 2011 03:10
Contact:

Re: Search in Files with a newline gives strange results

Post by primehalo » 07 Jun 2017 17:09

Here ya go. I just tried again with the new TextEd.exe you sent and it still happens.
Attachments
Clipboard01.png
Clipboard01.png (13.87 KiB) Viewed 1881 times

User avatar
Rickard Johansson
Site Admin
Posts: 5345
Joined: 19 Jul 2006 14:29

Re: Search in Files with a newline gives strange results

Post by Rickard Johansson » 07 Jun 2017 22:35

It's a file type issue. The search field uses CRLF for line feed, while the text files may use CR, LF or CRLF. I've made some changes and find/replace using a multi line find or replace text should work now, regardless of the file type when searching a folder.

Fixed in next release (v12.12).

User avatar
primehalo
Posts: 136
Joined: 16 Jun 2011 03:10
Contact:

Re: FIXED: Search in Files with a newline gives strange resu

Post by primehalo » 07 Jun 2017 23:16

Thanks for fixing it!

Post Reply