Changeset 2272


Ignore:
Timestamp:
12/30/08 01:57:31 (3 years ago)
Author:
szabgab
Message:

move the PPI syntax highlighting out from experimental to the Perl menu

Location:
trunk/Padre/lib/Padre/Wx/Menu
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Wx/Menu/Experimental.pm

    r2269 r2272  
    8585    ); 
    8686 
    87     # Experimental PPI-based highlighting 
    88     $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 setting 
    95             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 editor 
    102             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  
    11787    return $self; 
    11888} 
  • trunk/Padre/lib/Padre/Wx/Menu/Perl.pm

    r2271 r2272  
    6868    ); 
    6969 
     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 
    70101    return $self; 
    71102} 
Note: See TracChangeset for help on using the changeset viewer.