Changeset 11112


Ignore:
Timestamp:
03/14/10 11:57:28 (2 years ago)
Author:
jagd
Message:

fix newline_keep_column

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Document/Perl.pm

    r11061 r11112  
    12931293    my $line   = $editor->LineFromPosition($pos); 
    12941294    my $first  = $editor->PositionFromLine($line); 
    1295     my $col    = $pos - $editor->PositionFromLine( $editor->LineFromPosition($pos) ); 
    1296     my $text   = $editor->GetTextRange( $first, ( $pos - $first ) ); 
     1295    my $col    = $pos - $first; 
     1296    my $text   = $editor->GetTextRange($first, $pos); 
    12971297 
    12981298    $editor->AddText( $self->newline ); 
    12991299 
    1300     $pos   = $editor->GetCurrentPos; 
    1301     $first = $editor->PositionFromLine( $editor->LineFromPosition($pos) ); 
    1302  
    1303     #   my $col2 = $pos - $first; 
    1304     #   $editor->AddText( ' ' x ( $col - $col2 ) ); 
    1305  
    1306     # TO DO: Remove the part made by auto-ident before addtext: 
    1307     $text =~ s/[^\s\t\r\n]/ /g; 
     1300    $text =~ s/\S/ /g; 
    13081301    $editor->AddText($text); 
    13091302 
    1310     $editor->SetCurrentPos( $first + $col ); 
     1303    $editor->SetCurrentPos( $pos + $col + 1); 
    13111304 
    13121305    return 1; 
Note: See TracChangeset for help on using the changeset viewer.