Changeset 5517
- Timestamp:
- 06/23/09 20:36:44 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre-Plugin-Perl6/lib/Padre/Plugin/Perl6/Perl6Document.pm
r5510 r5517 247 247 my $line_text = $editor->GetTextRange($line_start, $line_end); 248 248 my $indent = ($line_text =~ /(^\s+)/) ? $1 : ''; 249 $editor->InsertText($line_start, "${indent}my $var_name;$nl"); 249 $line_text = 250 "${indent}my $var_name;$nl" . 251 $line_text; 252 $editor->SetSelection( $line_start, $line_end ); 253 $editor->ReplaceSelection( $line_text ); 250 254 }, 251 255 }; … … 285 289 my $line_text = $editor->GetTextRange($line_start, $line_end); 286 290 my $indent = ($line_text =~ /(^\s+)/) ? $1 : ''; 287 $editor->InsertText($line_start, 288 "${indent}sub $routine_name {$nl" . 291 $line_text = "${indent}sub $routine_name {$nl" . 289 292 "${indent}\t#XXX-implement$nl" . 290 "${indent}}$nl"); 293 "${indent}}$nl" . 294 $line_text; 295 $editor->SetSelection( $line_start, $line_end ); 296 $editor->ReplaceSelection( $line_text ); 291 297 }, 292 298 }; … … 647 653 listener => sub { 648 654 # 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, '# '); 655 # since #( is an embedded comment in Perl 6! see S02:166 656 my $line_start = $editor->PositionFromLine( $current_line_no ); 657 my $line_end = $editor->GetLineEndPosition( $current_line_no ); 658 my $line_text = $editor->GetTextRange($line_start, $line_end); 659 $line_text = "# ${line_text}"; 653 660 }, 654 661 };
Note: See TracChangeset
for help on using the changeset viewer.
