Changeset 7489
- Timestamp:
- 08/23/09 07:24:25 (2 years ago)
- File:
-
- 1 edited
-
trunk/Padre/lib/Padre/QuickFixProvider/Perl.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/QuickFixProvider/Perl.pm
r7488 r7489 33 33 my $current_line_no = $editor->GetCurrentLine; 34 34 35 if ( $text !~ / ^\s*usestrict/msx ) {35 if ( $text !~ /\s*use\s+strict/msx ) { 36 36 push @items, { 37 37 text => qq{Add 'use strict;'}, 38 38 listener => sub { 39 $text = 'use strict;' . $text; 40 } 39 my $line_start = $editor->PositionFromLine($current_line_no); 40 my $line_end = $editor->GetLineEndPosition($current_line_no); 41 my $line = $editor->GetTextRange($line_start,$line_end); 42 $line = qq{use strict;$line\n}; 43 $editor->SetSelection( $line_start, $line_end ); 44 $editor->ReplaceSelection($line); 45 } 41 46 }; 42 47 } 43 if ( $text !~ / ^\s*usewarnings/msx ) {48 if ( $text !~ /\s*use\s+warnings/msx ) { 44 49 push @items, { 45 50 text => qq{Add 'use warnings;'}, 46 51 listener => sub { 47 $text = 'use warnings;' . $text; 48 49 #$editor->ReplaceSelection( 50 } 52 my $line_start = $editor->PositionFromLine($current_line_no); 53 my $line_end = $editor->GetLineEndPosition($current_line_no); 54 my $line = $editor->GetTextRange($line_start,$line_end); 55 $line = qq{use warnings;$line\n}; 56 $editor->SetSelection( $line_start, $line_end ); 57 $editor->ReplaceSelection($line); 58 } 51 59 }; 52 60 }
Note: See TracChangeset
for help on using the changeset viewer.
