Page 1 of 1

tool:fgrep & code folding

Posted: Thu Mar 17, 2005 4:51 pm
by raz
I'm not sure if this is a bug or by design, but...
when I have code folded (hidden) and perform a tool / fgrep (find in files),
it does not find text that has been folded. This is not what I expect.
Details: C source code, example below
for example:


if (foobar)
<blah ...>
target text is here: HIT!

if (foobar)
{ .... }

If i use the tool/fgrep to search for "HIT" it will not 'find' it in 'folded' mode.

comments? thoughts? is this a bug, or by design?


Posted: Thu Mar 17, 2005 10:34 pm
by Guest
Hi Raz,

This is definitely a bug :)

As a test I used this bit of code:

Code: Select all

int main()
  if (1)
    // find that

  if (1)
    // find this

  return test;
and folded up the two if nodes. Then when I run xfgrep -f -n this bug.cpp on the file the search result are as follows:

Code: Select all

fgrep -f -n this bug.cpp
D:\temp\bug.cpp (10)     // find_this
But as you point out, when the enter key is used on this line of output the cursor ends up on line 14 (as shown in the status bar) and not on the line 10 displayed in the results window :(

I don't know if Zeus should open the fold in this case (my first impression would be to say that it should not), but it should definitely put the cursor on the folded line to indicate the text is located inside the fold.

I will add this to the bug list.

Cheers Jussi