Right now minus uses a highlighting technique while searching where first removes all ANSI escape sequences from the text data and then a search and then searches the entire text. If a match is found, it places an ANSI INVERT sequence right before the match and an ANSI NORMAL sequence right after the match. Then it places all the escape sequences that the original text had into the right position.
Now where this goes wrong is if a match has escape sequence inside it, minus does not place it at that position. This approach brings a more consistent highlighting throughout and makes the text look less funky at the cost of some inaccuracies. But sometimes this cost is unaffordable hence this PR.
With this we plan to further improve the search highlighting technique to where a user has two options:-
Get accurate search Highlighting which might make the text look funky if the text has placed ANSI escape sequences at weird locations.
Get a more consistent highlighting at the cost of some minor discrepancies. Although this was already available, it will also be improved overall where rather than ignoring escape sequences at the middle of search matches, it will place them right after where the search match ends.
Right now minus uses a highlighting technique while searching where first removes all ANSI escape sequences from the text data and then a search and then searches the entire text. If a match is found, it places an ANSI
INVERT
sequence right before the match and an ANSINORMAL
sequence right after the match. Then it places all the escape sequences that the original text had into the right position.Now where this goes wrong is if a match has escape sequence inside it, minus does not place it at that position. This approach brings a more consistent highlighting throughout and makes the text look less funky at the cost of some inaccuracies. But sometimes this cost is unaffordable hence this PR.
With this we plan to further improve the search highlighting technique to where a user has two options:-