Changeset 2272
- Timestamp:
- 12/30/08 01:57:31 (3 years ago)
- Location:
- trunk/Padre/lib/Padre/Wx/Menu
- Files:
-
- 2 edited
-
Experimental.pm (modified) (1 diff)
-
Perl.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/Wx/Menu/Experimental.pm
r2269 r2272 85 85 ); 86 86 87 # Experimental PPI-based highlighting88 $self->{ppi_highlight} = $self->AppendCheckItem( -1,89 Wx::gettext("Use PPI for Perl5 syntax highlighting")90 );91 Wx::Event::EVT_MENU( $main,92 $self->{ppi_highlight},93 sub {94 # Update the saved config setting95 my $config = Padre->ide->config;96 $config->{ppi_highlight} = $_[1]->IsChecked ? 1 : 0;97 98 # Refresh the menu (and MIME_LEXER hook)99 $self->refresh;100 101 # Update the colourise for each Perl editor102 foreach my $editor ( $_[0]->pages ) {103 my $doc = $editor->{Document};104 next unless $doc->isa('Padre::Document::Perl');105 if ( $config->{ppi_highlight} ) {106 $doc->colorize;107 } else {108 $doc->remove_color;109 $editor->Colourise( 0, $editor->GetLength );110 }111 }112 113 return;114 }115 );116 117 87 return $self; 118 88 } -
trunk/Padre/lib/Padre/Wx/Menu/Perl.pm
r2271 r2272 68 68 ); 69 69 70 # Experimental PPI-based highlighting 71 $self->{ppi_highlight} = $self->AppendCheckItem( -1, 72 Wx::gettext("Use PPI for Perl5 syntax highlighting") 73 ); 74 Wx::Event::EVT_MENU( $main, 75 $self->{ppi_highlight}, 76 sub { 77 # Update the saved config setting 78 my $config = Padre->ide->config; 79 $config->{ppi_highlight} = $_[1]->IsChecked ? 1 : 0; 80 81 # Refresh the menu (and MIME_LEXER hook) 82 $self->refresh; 83 84 # Update the colourise for each Perl editor 85 foreach my $editor ( $_[0]->pages ) { 86 my $doc = $editor->{Document}; 87 next unless $doc->isa('Padre::Document::Perl'); 88 if ( $config->{ppi_highlight} ) { 89 $doc->colorize; 90 } else { 91 $doc->remove_color; 92 $editor->Colourise( 0, $editor->GetLength ); 93 } 94 } 95 96 return; 97 } 98 ); 99 100 70 101 return $self; 71 102 }
Note: See TracChangeset
for help on using the changeset viewer.
