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

Closed
pvinis opened this Issue Oct 25, 2012 · 3 comments

Projects

None yet

4 participants

@petdance
Owner

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

cache-manager/php_src/PHPUnit-1.3.2/PHPUnit/TestResult.php
111-32-     * @access public
112-32-     */
113-32-    function addError(&$test, &$t) {
114:32:        $this->_errors[] = new PHPUnit_TestFailure($test, $t);
115-1-
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:

cache-manager/php_src/PHPUnit-1.3.2/PHPUnit/TestResult.php
111-     * @access public
112-     */
113-    function addError(&$test, &$t) {
114:        $this->_errors[] = new PHPUnit_TestFailure($test, $t);
115-
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
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!

Regards,

-- Shlomi Fish

@hoelzro
Collaborator
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