Jump to content
dummzeuch

Testers needed for GExperts Instant Grep expert

Recommended Posts

I wrote about the Instant Grep expert before when I was looking for a name for it.

Now it's nearly finished and I need testers for it.

Simply get the GExperts sources, compile a new DLL and replace the original DLL with the new one.

 

Instant Grep is in the menu (not sure yet whether it should be moved under the Grep submenu). You can assign a keyboard shortcut to it if you like. It opens a new (dockable) window which greps the current edtior file as you type a regular expression and gives you a list of matches. You can use the cursor keys (up/down/pageup/pagedown) to move to the lines it found, press Esc to go back to where you started, or Enter to activate the editor window.

 

The Window reacts when you switch to a different editor tab by searching that new file (only Delphi 2007 and higher).

 

Warning: I have been using the expert all day (in Delphi 10.2 and 2007) and found many bugs and annoyances, but I think I found and fixed most of them by now. But still: Installing a new GExperts DLL might make your IDE unstable and even crash it.

Share this post


Link to post

Issue at build - Rev. 4065

D11.3

..\..\images\GXIcons.rc : error : Error Could not open input file D:\GExperts\Projects\DelphiXx110Alexandria\VCL.RC [D:\GExperts\Projects\DelphiXx110Alexandria\GExper
tsRS110.dproj]
Done Building Project "D:\GExperts\Projects\DelphiXx110Alexandria\GExpertsRS110.dproj" (rebuild target(s)) -- FAILED.


Build FAILED.

"D:\GExperts\Projects\DelphiXx110Alexandria\GExpertsRS110.dproj" (rebuild target) (1) ->
(BrccCompile target) ->
  ..\..\images\GXIcons.rc : error : Error Could not open input file D:\GExperts\Projects\DelphiXx110Alexandria\VCL.RC [D:\GExperts\Projects\DelphiXx110Alexandria\GExp
ertsRS110.dproj]

    0 Warning(s)
    1 Error(s)

 

Share this post


Link to post

There is a batch file in the images subdirectory which creates the GXicons.rc file.

 

I should probably put that into the pre build scripts.

Edited by dummzeuch

Share this post


Link to post

I haven't received any feedback yet. Does that mean everything works fine and nobody has any ideas on improving that functionality?

Or was Ian the only one who tried the new version, and nobody else bothered?

Share this post


Link to post

I installed GExperts on primary machine with intent of loading the source to test how a background program sees it... Short answer 10 days out. Question is type "svn commands paths as needed" at cmd prompt or in the Navigator of a browser?  Liking to do on secondary machine which SSD is 8 years old so plan archiving disk and get machine with win11 pro before winter. Sorry, Boss 😞 

 

Here's how my program sees the GExpert ASCII Table. The blank line is the taskbar. Regardless of desktop the program focuses to instance clicked.  The user working on D11 in Desktop4 can click on the line ASCII Chart and windows surfaces ASCIITABLE window in DeskTop1 where say 10.4 is opened.  

hr 12.453 MTD - Delphi 11 - frmMultiDee [Running] [Built]
hr 12.470 frmMultiMain
hr 12.476 ASCII Chart
hr 12.477 frmMultiMain
hr 12.489 
hr 12.492 frmMultiMain

    

Share this post


Link to post

Doing a first short test: I was irritated as every hit is divided be the filename. As Instant Grep displays it's result only based on current editor file, why not just add the filename only to caption (see attached image)?

 

instant_grep.thumb.png.1df98eb468e4c31fee5cdd1f29affa06.png

 

Second: I compiled the current source, closed Delphi 11.3 and installed the new DLL. Now the first start showed that error:

 

error_IG.thumb.png.652fe5a1f7362c8fca3cedd1c0a9ce73.png

 

Following starts do not show it anymore. And why is the roaming profile? Shouldn't this be stored on LOCAL_APP_DATA?

 

Third, if there is no hit I would not show the entry 'Original Position'. At first I wondered, if this was a wrong hit of grep search, because I see something on result list I do not expect. If you want to show the original position, make it more clearer that this is *not* a search result.

 

 

kind regards,

Ulrich

  • Thanks 1

Share this post


Link to post

Next thing I noticed: I placed the window on a second monitor right beside the maximized IDE main window on first monitor. No problem. Now I closed Instant Grep and opened it again: the Window is placed on my first monitor instead of second one.

 

And how do I clear a former hit list? Entering a blank search phrase does not clear it. Also closing and reopening does not clear it.

  • Thanks 1

Share this post


Link to post

Hi Thomas,

I have just had a play with this functionality.

Agree with ULIK on the filename, although I am not sure how you would re-jig it.

Possibly retaining the row divider, without the filename, but putting the line # in a column on the left.  Like a two column String Grid??

Ian

  • Thanks 1

Share this post


Link to post
On 10/13/2023 at 3:17 AM, dummzeuch said:

Does that mean everything works fine and nobody has any ideas on improving that functionality?

Something is amiss for me: I'm building from r4065 and I can see files referring to Instant Grep, but there appears to be no menu item - is it not under the GExperts item?

 

On a side note: is there a plan to make GExperts respect the IDE theme? 

Share this post


Link to post
9 minutes ago, Ian Branch said:

It is under the Grep Menu.

Not there for me. I'm assuming I'm doing something wrong 🙂 I'll take a look at the code later...

Share this post


Link to post

It behaves strangely when resized:

17688158_Bildschirmfoto2023-10-14um14_46_56.thumb.png.299eec9ab12c32ac7997d463f5e47384.png

 

On a side note, the __Build_Project.cmd enters an infinite loop when run from a UNC-path like \\Mac\Home\Documents\Embarcadero\Studio\Projects.

  • Thanks 1

Share this post


Link to post
12 hours ago, Dave Nottage said:

Something is amiss for me: I'm building from r4065 and I can see files referring to Instant Grep, but there appears to be no menu item - is it not under the GExperts item?

It should be a separate menu entry in the GExperts menu.

 

12 hours ago, Dave Nottage said:

On a side note: is there a plan to make GExperts respect the IDE theme? 

No, unless somebody cares enough to implement support for that and submits a patch.

Share this post


Link to post
On 10/14/2023 at 1:30 PM, uligerhardt said:

MInor issue: Clicking the "Case sensitive" checkbox doesn't update the search.

Fixed in revision #4066. Thanks.

Edited by dummzeuch

Share this post


Link to post
On 10/14/2023 at 2:53 PM, Sherlock said:

It behaves strangely when resized:

17688158_Bildschirmfoto2023-10-14um14_46_56.thumb.png.299eec9ab12c32ac7997d463f5e47384.png

 

On a side note, the __Build_Project.cmd enters an infinite loop when run from a UNC-path like \\Mac\Home\Documents\Embarcadero\Studio\Projects.

Hm, that's a really odd problem: I traced through the code and it actually tries to redraw the whole entry, not just the part on the right. But apparently due to clipping only the right hand part actually gets drawn, leaving the part on the left unchanged. (That also applies to the Editor Bookmarks expert.

I wonder why the same does not happen in the Grep Results window, which also uses a TListBox in owner draw mode. The difference there is that headers containing the file name and number of matches and the actual lines that match are separate lines, while in Instant Grep and Editor Bookmarks one line contains both, the header and the matches. But the drawing code is nearly identical.

Share this post


Link to post
14 minutes ago, dummzeuch said:

Hm, that's a really odd problem: I traced through the code and it actually tries to redraw the whole entry, not just the part on the right. But apparently due to clipping only the right hand part actually gets drawn, leaving the part on the left unchanged. (That also applies to the Editor Bookmarks expert.

I wonder why the same does not happen in the Grep Results window, which also uses a TListBox in owner draw mode. The difference there is that headers containing the file name and number of matches and the actual lines that match are separate lines, while in Instant Grep and Editor Bookmarks one line contains both, the header and the matches. But the drawing code is nearly identical.

Fixed in revsion #4067 by putting a panel between form and listbox. (No idea why this works, but I tried that because the Grep Results window also had a panel as parent for the listbox. Maybe that's the reason why that panel exists there too.

  • Thanks 1

Share this post


Link to post
On 10/13/2023 at 1:44 PM, ULIK said:

Doing a first short test: I was irritated as every hit is divided be the filename. As Instant Grep displays it's result only based on current editor file, why not just add the filename only to caption (see attached image)?

 

instant_grep.thumb.png.1df98eb468e4c31fee5cdd1f29affa06.png

 

Third, if there is no hit I would not show the entry 'Original Position'. At first I wondered, if this was a wrong hit of grep search, because I see something on result list I do not expect. If you want to show the original position, make it more clearer that this is *not* a search result.

As of revision #4069 the original position is only shown if there are matches.

 

I'm not sure about showing the filename. Yes, it's not really necessary, but since it also shows the line number on the right (which I definitely want to keep), not showing the filename would leave that line mostly blank.

Edited by dummzeuch

Share this post


Link to post
6 minutes ago, dummzeuch said:

I'm not sure about showing the filename. Yes, it's not really necessary, but since it also shows the line number on the right (which I definitely want to keep), not showing the filename would leave that line mostly blank.

I faced this problem many time and almost always, converted the view into table,

So i would suggest ,to make the file name and line number as they are, move the result to right and up, hence the first line in each section (result) will have the file name and the first result and line number while the result form the same file will only result under the first one, hope that is clear, also make the result switch background color for the same file, between two or more color, something easy on the eyes but yet will show the result grouping.

image.thumb.png.7cfd283daaf314fffa03f65d98df6ecf.png

 

Well Windows Paint is not Photoshop, yet i am happy with my Paint talent 😎

Share this post


Link to post
13 hours ago, Kas Ob. said:

I faced this problem many time and almost always, converted the view into table,

So i would suggest ,to make the file name and line number as they are, move the result to right and up, hence the first line in each section (result) will have the file name and the first result and line number while the result form the same file will only result under the first one, hope that is clear, also make the result switch background color for the same file, between two or more color, something easy on the eyes but yet will show the result grouping.

image.thumb.png.7cfd283daaf314fffa03f65d98df6ecf.png

 

Well Windows Paint is not Photoshop, yet i am happy with my Paint talent 😎

Hm, yes that could be done. On the other hand, I could move the line number to the left column too, so it occupies the space under the file name which you left empty.

  • Like 1

Share this post


Link to post

Unless I'm missing something, isn't the filename going to be the one open/in view att?

Thus IMO the filename is redundant.  Just have the line # in the left column.

Share this post


Link to post
14 minutes ago, Ian Branch said:

Unless I'm missing something, isn't the filename going to be the one open/in view att?

Thus IMO the filename is redundant.  Just have the line # in the left column.

Yes, it is indeed (as somebody else already mentioned). I originally copied the code from the Editor Bookmarks expert and the plan was to somehow consolidate those copies again. But there, it's also only the current file, so the filename is redundant too. I'll have to think about it some more (and find the time for it).

Share this post


Link to post

Next nitpick: If the Instant Grep window is focussed, pressing Shift-Alt-S brings up the Grep submenu. If I dismiss it (by clicking somewhere else) the expected Grep dialog shows.

Share this post


Link to post
2 hours ago, dummzeuch said:

Hm, yes that could be done. On the other hand, I could move the line number to the left column too, so it occupies the space under the file name which you left empty. 

So, something like this?

Filename.pas | if (True) then
Line 1234    |   DoSomething()
             | else
-------------+---------------------------
Filename.pas | // Comment
Line 4567    | DoSomething();
             |

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×