There is some strange bug that causes line numbers in errors coming from
perl to come out wrong in some circumstances.

This code:

     perl <<END_PERL
     # line 3 line_number_test.vim

     if ( 0 ) {
     die "I don't cause trouble because I'm all on one line";
     }

     die "I am really line 8";

behaves as expected when openened and :so %.

This code ends up wrongly reporting the error as being on line 10:

     perl <<END_PERL
     # line 3 line_number_test.vim

     if ( 0 ) {
     die
     "I DO cause trouble perhaps because I'm not all on one line?";
     }

     die "I am really line 9";

The bug is not in perl because this script:

     #!/usr/bin/perl -w
     # line 3

     use strict;

     if ( 0 ) {
     die
     "I don't happen";
     }

     die "I do happen";

works as expected.

The problem is the same for compile time errors (e.g. $foo = "bar" with $foo
undeclared and warnings fatal) as for run-time ones.

The scripts are attached in case anyone wants to try them.

I suspect that vim is getting clever and rewriting the die code somehow and
accidently adding a line in some cases or something, but I haven't looked
into it at all.

I'm really hoping someone can tell me what's going on or where to look.
I just released http://www.vim.org/scripts/script.php?script_id=3406 and
http://www.vim.org/scripts/script.php?script_id=3411 but I'll have to pull
them if they are inevitably going to commit that most unholy crime of lying
to people who are trying to debug.

Thanks,
Britton

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Attachment: line_number_test_succeed.vim
Description: Binary data

Attachment: line_number_test_fail.vim
Description: Binary data

Attachment: line_number_test_perl_succeed.perl
Description: Binary data

Raspunde prin e-mail lui