SlickEdit Community

Archived Read Only Forums => SlickEdit 2018 v23 Beta Discussion => Topic started by: jporkkahtc on October 19, 2018, 08:42:56 pm

Title: Find all occurrences, with context, Filter Search Results
Post by: jporkkahtc on October 19, 2018, 08:42:56 pm
Given a text file with this:
Code: [Select]
MATCH_TEXT 1
    context1
MATCH_TEXT 2
    context3 SPECIAL
MATCH_TEXT 3
    context2
MATCH_TEXT 4
    context1

Search for All Occurrences of MATCH_TEXT, LinesBeforeAfter = 0,1

Now, in search results, Filter search results for "SPECIAL".
If KeepLine, all results are removed.
If DeleteLine, all context is removed.

#1: This result is self-inconsistent: If Keep removed everything, then Delete should not remove anything.
#2: Filter seems to always remove all context -- it shouldn't do that!
#3: What is the "Filter Files" tab? It isn't documented.

More Useful: KeepLine should result in:
Code: [Select]
Find all "MATCH_TEXT"
File Untitled<2>
  3 1:MATCH_TEXT 2
    +:    context3 SPECIAL
Total found: 4
And DeleteLine should result in:
Code: [Select]
Find all "MATCH_TEXT"
File Untitled<2>
  1 1:MATCH_TEXT 1
    +:    context1
  5 1:MATCH_TEXT 3
    +:    context2
  7 1:MATCH_TEXT 4
    +:    context1
Total found: 4

Filter should filter based on the context, as well as the matching text.
Title: Re: Find all occurrences, with context, Filter Search Results
Post by: Lee on October 20, 2018, 03:06:27 pm
For Filter Search Results text, it only searches a result line.  It ignores before/after (+/-) lines and any File or context line.  It does currently remove before/after line for all results whether using Keep or Delete, that is a behavior we can revise or change.  If a result line is deleted, can’t keep any +/- lines paired with no way to correctly navigate to the line number.  I can look into changing the behavior to keeping +/- for results that are not deleted.

Filter Search Results File, it only searches File line allowing you to remove results for all matching files using the the same behavior of the File Types wildcard and Exclude wildcard from Find in Files.  It documented in the Find in Files section for Search Results.