Find-In-Files ignores files?

Discussion about CodeLite development process and patches
apa
CodeLite Enthusiast
Posts: 11
Joined: Fri Apr 17, 2009 11:56 pm
Contact:

Find-In-Files ignores files?

Post by apa » Wed Jan 20, 2010 9:42 pm

Hi,
I have a strange problem (CodeLite 2.1.0.3584, runnning on WIN2k):

My workspace has some 500 files. I invoke the Find-in-Files dialog, select "Find What", select a directory (and its
subdirectories) to be searched, select all *.c;*.cpp, ... files to be searched, leave all options unchecked.

Search is done and put to a new "Find Results" output window.

Problem is that one file that is within the directories to be searched and within the pattern to be searched
does not seem to searched. How do I found this out?
a) opening the file in and searching with the Find dialog brings up the missing occurences
b) doing the same thing with 2 other editors brings up the missing occurences (in addition to the ones that CodeLite found, too,
ie. for a subset of the searched files all editors have the same result)

Do you have any ideas what could go wrong?

I have the strange feeling that this behaviour came up after upgrading to 2.1.0.3584.
Moreover, since the Trace Window tells me that
18:12:12: Error: can't open file 'C:\Temp\CodeLiteConfig\avx1_main1_dev_1\avx1_main1_dev_1.workspace.pauschar' (error 2: das System kann die angegebene Datei nicht finden.)
That is true, there is no such file in this directory, instead it is named xyz.workspace.session

Thx for any help
Arndt

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Find-In-Files ignores files?

Post by eranif » Wed Jan 20, 2010 10:05 pm

apa wrote:I have the strange feeling that this behaviour came up after upgrading to 2.1.0.3584.
No changes were made to the Find In Files for a long time, so I doubt that this is the reason (you may downgrade to a lower version of codelite to confirm this)
apa wrote:18:12:12: Error: can't open file 'C:\Temp\CodeLiteConfig\avx1_main1_dev_1\avx1_main1_dev_1.workspace.pauschar' (error 2: das System kann die angegebene Datei nicht finden.)
This is error is normal (since the introduction of the 'Local Workspace' concept in 2.1), furthermore, this error was removed in trunk.

My best guess is that the file that you have mentioned, contains some non-ascii characters which breaks the search. To fix this, change the default editor's config to match your locale (from the menu: settings > global editor preferences > misc) and then in the 'Find In Files' tick the option that says: "use editor's font encoding"

see here for more details (simple forum search for 'encoding'):
http://codelite.org/forum/viewtopic.php ... ding#p2336
http://codelite.org/forum/viewtopic.php ... ding#p2162

Eran
Make sure you have read the HOW TO POST thread

apa
CodeLite Enthusiast
Posts: 11
Joined: Fri Apr 17, 2009 11:56 pm
Contact:

Re: Find-In-Files ignores files?

Post by apa » Thu Jan 21, 2010 1:14 pm

Eran,

thank for your help, the file encoding is indeed the problem. The questionable file has German Umlaut
characters ... removing them solves the problem.

Out of curiosity:
a) I was trying to find a correct "file font encoding" setting in the Misc dialog. I haven't tried
all, but some of them. None of my settings would make "Find-In-Files" find
b) all of above font selections with or without "Use editor's font encoding" did not help either, it would
never find the search string. Do you have any idea why this would be the case?
c) Why does the normal "Find" dialog has no problems finding the search string (when the file is open)?

Again, thx for your fast help
Arndt

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Find-In-Files ignores files?

Post by eranif » Thu Jan 21, 2010 1:49 pm

apa wrote:a) I was trying to find a correct "file font encoding" setting in the Misc dialog. I haven't tried
all, but some of them. None of my settings would make "Find-In-Files" find
Search the forum for 'umlaut' I think someone already meat this issue
apa wrote:b) all of above font selections with or without "Use editor's font encoding" did not help either, it would
never find the search string. Do you have any idea why this would be the case?
Probably because you did not manage to pin point the correct file encoding.
apa wrote:c) Why does the normal "Find" dialog has no problems finding the search string (when the file is open)?
The search is perform in the editor itself, while 'Find in files' works directly on the files.

Btw, can u send me the "problematic" file with instructions for how to reproduce the problem?

Eran
Make sure you have read the HOW TO POST thread

apa
CodeLite Enthusiast
Posts: 11
Joined: Fri Apr 17, 2009 11:56 pm
Contact:

Re: Find-In-Files ignores files?

Post by apa » Thu Jan 21, 2010 6:21 pm

Eran,

I attached the problem file(s), in fact I attached 2 files:
CLiteTest.c and CLiteTest2.c

I added both to my workspace, to be more specific I added both to a virtual folder.
I used Find-in-Files (FIF) to search for "THIS_IS_A"
Search returns a match for CLiteTest2.c, not for CLiteTest.c

Settings are: File Font Encoding is UTF-8, FIF dialog has everything unchecked.
Doing FIF with "use editor's font encoding" checked does not change a thing - checking it makes it switch to UTF-8
which is selected anyway. right?

CLiteTest.c has been edited by Codewright because I cannot disclose the original file.
CLiteTest2.c has been saved after opening CLiteTest.c in CL, just touching a few characters and backing out.

Hope that helps
Arndt
You do not have the required permissions to view the files attached to this post.

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Find-In-Files ignores files?

Post by eranif » Thu Jan 21, 2010 6:32 pm

Hi,

1) Change the editor font to ISO-8859-1 (the first entry) from 'Settings > Global Editor Preferences > Misc'
2) in FIF dialog, check the option 'Use the editor's font encoding'

You should see both results now

Eran
Make sure you have read the HOW TO POST thread

apa
CodeLite Enthusiast
Posts: 11
Joined: Fri Apr 17, 2009 11:56 pm
Contact:

Re: Find-In-Files ignores files?

Post by apa » Thu Jan 21, 2010 10:06 pm

Thank you, that finally solves the problem ...
Arndt

Post Reply