This is about Delphi 6. I received this via email:
I've picked up the grep search funcitonality doesn't work as expected in the last couple of versions.
For example, I had 1.38 and tried a few prior ones. If I search for a specific number that I know exists in one of my dfm files, it's not picked up. If I open that form, and then repeat the search, then it picks it up. If I close the form again, and repeat the same search, its ommitted.
I noticed the specific search works on a colleagues machine and I noted he had 1.11 on, very very old. I tried 1.12 and now the search works.
We are still working in Delphi 6.
Bug Details:
The bug is reproducible 100% of the time
The bug is project specific
Steps:
Configuration:
OS: Windows 6.2 (Build 9200)
GExperts: GExpert6.dll 1.1.2.0 from 14/09/2036 18:24:52
reported via email by Frank Pedro
Diff:
I just tried to reproduce this in the current source code, but could not.
It found both instances of the string, one in the pas file, the other one in the dfm file.
I need steps to reliably reproduce the problem, otherwise I can't do anything.
Last edit: Thomas Mueller 2019-07-21
Grep searching in DFM files is broken since Rev. 2580: If a match is found, the wrong source line is used to display the match position; it is always the first line. This is because in GX_GrepRegExSearch.pas, procedure HandleFormLine(), line 183, the wrong line index is used.
Changing
doSearchLine(_Line, _LineIdx);todoSearchLine(_Line, _CurrLineIdx);solves the problem. Maybe the code for handling multi-line DFMs has the same issue since_LineIdxis used there, too.(I'm not sure if this is the same what the original bug reporter has found.)
Thanks Achim, this fixed a problem when multiline search was not enabled. Maybe this also fixes the problem originally reported. I don't know since I could never reproduce it.
svn revision #2649
@Frank Pedro: Please check whether the problem has been fixed.
Since I haven't heard back from the original poster, I am assuming that the bug was fixed. If not, please file a new bug report.