Author Topic: Best Practice / Tips for Multiple File Find and then Review  (Read 2339 times)

Kristen

  • Community Member
  • Posts: 15
  • Hero Points: 8
Best Practice / Tips for Multiple File Find and then Review
« on: January 08, 2019, 10:19:51 AM »
I do Find in Files and get a list of matched files in [Search Results] (I have "List filenames only" checked)

I click on the first one.  The file opens, cursor at top-of-file, line 1.

If I press F3 (find next) the next file is displayed.

Instead I have to do Control-F (Find), the current "Search for" is correctly displayed, so I just press ENTER) and the first match is scrolled / highlighted.

I can now press F3 (find next) to walk through all the matches in that file.

When I get to the end I have to F4-Close that file then click on the next one.
(The next file might be at cursor-position from last edit, so first match might be above cursor)
If I press F3 (find next) at this point I again get next-file, instead of first match, so I have to do Control-F (find) and OK to find first match ... and then I can use F3 (Find next) ...

Seems very cack-handed! to me ... so I expect there is a Better Way :)

Interested to hear what other people do and/or if there is an OPTION that I could change ... or a Macro that I should be writing. (I didn't find a key-binding for "Next search result file")

Thanks

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: Best Practice / Tips for Multiple File Find and then Review
« Reply #1 on: January 08, 2019, 11:57:10 AM »
You can use Ctrl+, to jump back to the list.  Also it looks like find-next (bound to Ctrl+G in CUA mode) will jump to the next file.  Hope this helps.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Best Practice / Tips for Multiple File Find and then Review
« Reply #2 on: January 08, 2019, 03:14:03 PM »
The behavior for Find Next command is different for Find in Files vs Find.  For Find, it always searches for the next/prev occurrence in the current file buffer.  For Find in Files, it goes to the next/prev result listed in the Search Results.  With List Filenames only enabled, there are only file results and no actual search results reported. 

There isn't an option to search occurrences in file only Search Results.  It is working as designed, but that doesn't mean that it could be improved.  I checked the feature/bug tracker, and this is the first report for this.  I'll file a feature request and investigate to see if improvement can be made for this use case. 

Also, you are correct there is technically not a command to jump to next/prev file in search results.  I can file a feature request for that too.

Kristen

  • Community Member
  • Posts: 15
  • Hero Points: 8
Re: Best Practice / Tips for Multiple File Find and then Review
« Reply #3 on: January 08, 2019, 04:34:08 PM »
Thanks.

If I uncheck LIST FILENAMES then I can do:

Navigate to first match.
Review/Edit as appropriate
F3 (Find-Next) finds either the next match (in current file) if there is one or jumps to first match in next file.

It doesn't close the now-completed file, so I wind up with a lot of tabs, but that's not a big issue. I can SAVE the modified TABs periodically as I go. (And files that I do not modify cause that TAB to be reused for next-file, so sorting out the "needs saving" is straightforward)

Reason for using LIST FILENAMES method is because I have sub-folders called ARCHIVE which contains "just-in-case / belt-and-braces" versions of files, and I typically want to skip those as I go.  Its easier to see, with only filenames, that a batch of ARCHIVE\foo.bar files are coming up if I use the filename list method (otherwise typically I will have started editing them before I realise I'm amongst them :( )

I could move the ARCHIVE folders out of the Project path, but being lazy its easier to have ARCHIVE as child-of-current for all batch-based operations.

You can use Ctrl+, to jump back to the list

What's the command that is normally bound to pls?  I seem to have it bound to wfont-zoom-in

The number-pad Control-
  • doesn't seem to do anything (I don't have Ctrl+PadPlus bound to anything)


Is there an easy way to see what the default binding for a keystoke etc. would have been?

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: Best Practice / Tips for Multiple File Find and then Review
« Reply #4 on: January 08, 2019, 08:27:20 PM »
In find in files you can exclude the archives.
In the FiF dialog, in the "Exclude" box, enter "ARCHIVE/"

In the search results window you can also remove unwanted results... Right click in the results text area and pick "Filter search results"
Then pick the "Filter files" tab.

Kristen

  • Community Member
  • Posts: 15
  • Hero Points: 8
Re: Best Practice / Tips for Multiple File Find and then Review
« Reply #5 on: January 09, 2019, 09:30:37 AM »
Shamed I didn't think of that !

I was thinking of a complicate list of folders to include - with the risk that a newly added folder would not be included.  Our naming-convention is rigidly enforced :), so "Exclude folder" will be perfect, thanks.