Bug 425893 - Hide/show text based on filter
Summary: Hide/show text based on filter
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 20.08.0
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-28 10:47 UTC by Paul Fee
Modified: 2020-11-11 14:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Fee 2020-08-28 10:47:14 UTC
SUMMARY
When viewing large files in Kate, I want to filter the lines to reduce visible lines.

STEPS TO REPRODUCE
1. Examine large but noisy logs, e.g. /var/log/messages
2. On the command line, grep allows logs to be filtered.
3. I want a way to filter matching or non-matching lines in Kate.

OBSERVED RESULT
Kate includes a "Find" facility (CTRL+F).  However it lacks the ability to hide non-matching text.

EXPECTED RESULT
Extend the "power search and replace bar" to include three choices:
* No filtering (the current behaviour)
* Show matching lines
* Hide matching lines

Since the "Find" expression already supports regular expression mode, the user has lots of flexibility in deciding what to show/hide.  Hidden lines are still in the document, the hide/show steps don't modify the text of the document.

ADDITIONAL INFORMATION
The ability to filter large unstructured files provides benefit similar to code folding for source code, e.g. C++.  Wireshark's "display filters" provide a similar concept, though in quite a different context.
Comment 1 Christoph Feck 2020-09-10 08:55:14 UTC
Kate is not a log viewer, but a text editor. I suggest to use a specialized log viewer which has filtering features.

Implementing this feature in a text editor requires major code changes, because people would expect that it also works while editing.
Comment 2 Paul Fee 2020-09-10 12:36:33 UTC
Thanks for responding.  I had hoped that the existing code folding functionality, that allows blocks of source code to be collapsed/expanded would allow lines that match a filter to be hidden/shown without too much difficulty.  However I'm not familiar with the Kate source code so can't judge how big an effort this would be.

I'm setting this to "Resolved/Not a Bug" since you've indicated the code changes would be major.  There's also merit in not trying to add every possible feature to Kate.  Perhaps a dedicated log viewer (can you recommend one?) would be better, allowing Kate to keep its focus on editing.