Author Topic: Search Feature : _mffind() : Automatic (macro) alignment of result columns  (Read 2368 times)

PurdueEEGrad

  • Senior Community Member
  • Posts: 115
  • Hero Points: -17
All of my code is structured for maximum visibility via grep searches of the
code base.  When I say structured I mean the grep results line up so well - it
almost looks like database records - and thus makes the grep results a lot
easier to read (see attached).

I grep code with _mffind() as follows;

   _mffind(target_tag_str,'I',MFFIND_BUFFER,'',MFFIND_GLOBAL | MFFIND_SINGLELINE, false, false, '', '', true, 0);

I can align the search result columns, manually using the GUI, with a;

   Right Click -> Align Columns

Is there a way to do this automatically in a macro - so the results are clean
and easy to read - right from the start?

I looked for a - [Feature Action] <=> [Macro] mapping - in the help, but could
not find any.

The _mffind() help page - did not have any links (at the bottom) to macros
controlling the search result window pane output format.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1274
  • Hero Points: 126
Align columns is not currently exposed as an external command or function, I can easily add that one for the next beta drop.  I will followup this post when it is implemented and how to use it.

hs2

  • Senior Community Member
  • Posts: 2737
  • Hero Points: 288
++ and an persistent auto-align option would be nice ;)
Thanks, HS2

PurdueEEGrad

  • Senior Community Member
  • Posts: 115
  • Hero Points: -17
Thank you so much :-)

I will test it as soon as it comes out!

PurdueEEGrad

  • Senior Community Member
  • Posts: 115
  • Hero Points: -17
Re: Search Feature : _mffind() : Automatic (macro) alignment of result columns
« Reply #4 on: November 03, 2014, 02:06:59 pm »
Just a quick update for testing SE V19 RC2 (Release candidate 2).

It would be better if there was a user defined option - to simply keep all
search results - in a column aligned state.

I checked the SE V19 RC2 Options state space - and did not find any
options related to keeping search results - in a column aligned state.

If possible - it would be really helpful (visually speaking) - to have
this Option (Keep search results in a column aligned state) - in the
final SE V19 release product.

My world of software engineering lives in the search window pane
of your product (SE) - since use code tags (_str, _dba, _evt, ...).

Since there is so much for the SE team to do - I understand if
this feature request does not make it into the final SE V19 release
cycle.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1274
  • Hero Points: 126
Re: Search Feature : _mffind() : Automatic (macro) alignment of result columns
« Reply #5 on: November 03, 2014, 02:15:08 pm »
I was able to add commands (available in RC1 going forward) that exposed align columns and collapse/expand search results:
Code: [Select]
_command void grep_align_columns(int grep_id = 0)
_command void grep_collapse_all(int grep_id = 0)
_command void grep_expand_all(int grep_id = 0)
_command void grep_collapse_files(int grep_id = 0)

You can pass the search results id to the function and the action will be performed.  They are currently on-demand features. I have not had a chance to add any preferences to have them done automatically after a search, but should be possible to do in the future or to add to any custom macros you have that do searches.

PurdueEEGrad

  • Senior Community Member
  • Posts: 115
  • Hero Points: -17
Re: Search Feature : _mffind() : Automatic (macro) alignment of result columns
« Reply #6 on: November 04, 2014, 02:44:26 pm »
This is wonderful!!!

I will implement these in my code base for now.

As this feature evolves (in the SE code base) - I'll migrate my code to adopt
an SE MDI Menu -> Tools -> Options approach - to having the columns aligned.

For now - this saves time in constantly using the right click align column feature
of the search result panes.

Thanks, again, for putting these APIs in - so I can evolve my SE module set -
to the latest features in SE V19 :-)

PurdueEEGrad

  • Senior Community Member
  • Posts: 115
  • Hero Points: -17
Re: Search Feature : _mffind() : Automatic (macro) alignment of result columns
« Reply #7 on: November 04, 2014, 07:34:13 pm »
Works like a charm :-)

All four result scopes work fine (file, project, workspace, open buffers).

Testcase attached. Tested on SE V19 RC2.