Changeset 5510


Ignore:
Timestamp:
06/23/09 11:23:53 (3 years ago)
Author:
azawawi
Message:

[Perl 6] 'Comment error line' is more accurate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre-Plugin-Perl6/lib/Padre/Plugin/Perl6/Perl6Document.pm

    r5509 r5510  
    640640         
    641641        # add "comment error line" as the last resort to solving an issue 
    642         push @items, { 
    643             text     => Wx::gettext('Comment error line'), 
    644             listener => sub { 
    645                 # comment current error by putting a hash and a space 
    646                 # since #( is an embedded comment in Perl 6! 
    647                 # see S02:166 
    648                 my $line_start = $editor->PositionFromLine( $current_line_no ); 
    649                 $editor->InsertText($line_start, '# '); 
    650             }, 
    651         }; 
     642        foreach my $issue ( @{$self->{issues}} ) { 
     643            my $issue_line_no = $issue->{line} - 1; 
     644            if($issue_line_no == $current_line_no) { 
     645                push @items, { 
     646                    text     => Wx::gettext('Comment error line'), 
     647                    listener => sub { 
     648                        # comment current error by putting a hash and a space 
     649                        # since #( is an embedded comment in Perl 6! 
     650                        # see S02:166 
     651                        my $line_start = $editor->PositionFromLine( $current_line_no ); 
     652                        $editor->InsertText($line_start, '# '); 
     653                    }, 
     654                }; 
     655                last; 
     656            } 
     657        } 
    652658         
    653659    } else { 
Note: See TracChangeset for help on using the changeset viewer.