Diffusion Kate bfdd0006d19f

S&R: Only add maximum 70 characters context before & after match.

Authored by sars on Dec 6 2018, 3:51 PM.

Description

S&R: Only add maximum 70 characters context before & after match.

Details

Committed
sarsDec 6 2018, 3:51 PM
Parents
R40:638cb985cd9e: S&R: Make one transaction for the whole replace to speed up things
Branches
Unknown
Tags
Unknown
guotao added a subscriber: guotao.Jun 26 2019, 7:16 AM

Hi, what's the benefit of this change?
Why max length is 70? It's so short on 4K monitor.
When analyze huge log file with timestamp, I can not get full line information


Can you add an option to turn off this feature?
And option for max length?

sars added a comment.Jun 26 2019, 9:21 AM

Imagine you have a "minimized" javascript or XML file. You basically have the whole file on one line. This can be thousands of characters on a line. If you now search for a fairly common word in the minimized code, you would duplicate the huge line as many times as you get matches.

The context length was added so that you only get a finite amount of characters per match.

I assume that in 99,99% of the time, having configuration for this context length is not worth it.

A workaround for your problem could be to include the timestamp in the search expression (regular expression)
\d\d-\d\d\s\d\d:\d\d.*<your search here>

Hope this helps,

/Kåre

For minimized js/xml, I prefer pretty it first.
The timestamp I mentioned is just an example.
I need the full line most time when I analyze such kernel log, adb log.
This seems a workaroud

^.*keyword

But not convenient.
So,could you please add an option to turn off this feature at least?