beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 138 forks source link

Highlighting wonky when using grouping #626

Closed petek closed 7 years ago

petek commented 7 years ago

Highlighting is not behaving as I would expect when I use grouping in certain cases.

To start, create a text file (bar.txt) with 3 lines:

     foo 
    _foo
    afoo

In the first case below, the highlighting is incorrect. In all other cases, it is correct.

$ ack '(^|[^_])foo' bar.txt foo afoo $ ack '(^|[^_])(foo)' bar.txt foo afoo $ ack '(?:^|[^_])foo' bar.txt foo afoo $ ack '((^|[^_])foo)' bar.txt foo afoo

petdance commented 7 years ago

This is an intentional feature. It is removed in ack3.