Error showing search results for a file with mixed EOL

Tool for Search and Replace across multiple files.
Post Reply
d0vgan
Posts: 4
Joined: Mon Sep 20, 2021 4:21 pm

Error showing search results for a file with mixed EOL

Post by d0vgan »

I'm having a file "1.h" with ANSI encoding and mixed line endings: the most part of the file has "\n" line endings, but some lines have "\r\n" line endings.
The beginning of the file has "\n" line endings:

Code: Select all

// 1.h
#include "aaa.h"
#include "bbb.h"
#include "ccc.h"
#include "ddd.h"	

...
Then this part has "\r\n" line endings:

Code: Select all

	enum EnumType : unsigned int {
		eee1 = 0,
		eee2,
		eee3
	};
The rest of the file has "\n" line endings again.

Now, I'm searching for a word eee2 in this file and here is what TextCrawler Pro 3.1.2 shows me with its option "No. lines to display above/below found text" set to 2 :

Code: Select all

 C:\Temp\1.h 
      1   // 1.h
      2   #include "aaa.h"
      3   		eee2,
      4   #include "ccc.h"
      5   #include "ddd.h"	
As you can see, the line numbers are incorrect as well as the text around the match is also incorrect...
Could it be because TextCrawler expects "\r\n" line ending everywhere but in fact it is "\n" ?
d0vgan
Posts: 4
Joined: Mon Sep 20, 2021 4:21 pm

Re: Error showing search results for a file with mixed EOL

Post by d0vgan »

Also I'm having a small feature request regarding the lines shown above/below the search results. As the lines above/below are a context added to the actual search result, could we have a new option to specify the color of these above/below lines?
Here as a visual example of what I mean (the lines above/below have grey color):
Image
d0vgan
Posts: 4
Joined: Mon Sep 20, 2021 4:21 pm

Re: Error showing search results for a file with mixed EOL

Post by d0vgan »

Any update on this, please?
I'm using a licensed version in my work, and the example with mixed EOL reflects the actual source code in the repository.
Once this issue in TextCrawler Pro is fixed, I'll recommend it to my colleagues!
User avatar
DigitalVolcano
Site Admin
Posts: 1463
Joined: Thu Jun 09, 2011 10:04 am

Re: Error showing search results for a file with mixed EOL

Post by DigitalVolcano »

Thanks for posting this - it looks like a possible issue with previewing mixed line endings. I've logged it to be fixed in an update.

I'll add a request for the line colour option too.
Post Reply