flags '--column' and '--context' together produce an error #240

pvinis opened this Issue Oct 25, 2012 · 3 comments


None yet

4 participants


I tried executing ack --column -C 3 PHPUnit_TestF and get something like this

111-32-     * @access public
112-32-     */
113-32-    function addError(&$test, &$t) {
114:32:        $this->_errors[] = new PHPUnit_TestFailure($test, $t);
Use of uninitialized value $match_start in addition (+) at /usr/local/bin/ack line 2208, <$__ANONIO__> line 116.
116-1-        for ($i = 0; $i < sizeof($this->_listeners); $i++) {
Use of uninitialized value $match_start in addition (+) at /usr/local/bin/ack line 2208, <$__ANONIO__> line 117.
117-1-            $this->_listeners[$i]->addError($test, $t);

I didn't know what this $match_start was, or the reason for that message. I tried ack -C 3 PHPUnit_TestF, the same without the --column flag, and I got this:

111-     * @access public
112-     */
113-    function addError(&$test, &$t) {
114:        $this->_errors[] = new PHPUnit_TestFailure($test, $t);
116-        for ($i = 0; $i < sizeof($this->_listeners); $i++) {
117-            $this->_listeners[$i]->addError($test, $t);

which is the right output.
could you fix that?
the column flag should print the column number only on the line that the search pattern exists.

shlomif commented Dec 12, 2012

Hi, and thanks for your work on Ack.

I ran into the bug, because the Vim ack plugin always adds the "--column" flag. Where can I find the pull request, the branch and the code with the fix (so I can apply them on my local system until an update is uploaded to CPAN)? They are not linked anywhere from here, or the linked discussion on the mailing list, and git is not being very helpful.

Thanks in advance!


-- Shlomi Fish

hoelzro commented Aug 28, 2013

Moved to ack2 queue.

@hoelzro hoelzro closed this Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment