Changeset 5367


Ignore:
Timestamp:
06/19/09 11:22:37 (3 years ago)
Author:
azawawi
Message:

[Perl 6] added colorizer configuration parameter and added a better check for default.

Location:
trunk/Padre-Plugin-Perl6/lib/Padre/Plugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre-Plugin-Perl6/lib/Padre/Plugin/Perl6.pm

    r5356 r5367  
    6060    # Read the plugin configuration, and create it if it is not there 
    6161    $config = $self->config_read; 
    62     if(! $config) { 
     62    if(not $config) { 
    6363        # no configuration, let us write some defaults 
    64         $config = {p6_highlight => 0}; 
    65         $self->config_write($config); 
    66     } 
     64        $config = {}; 
     65    } 
     66     
     67    # make sure defaults are respected if they are undefined. 
     68    if(not defined $config->{colorizer}) { 
     69        $config->{colorizer} = 'STD'; 
     70    } 
     71    if(not defined $config->{p6_highlight}) { 
     72        $config->{p6_highlight} = 0; 
     73    } 
     74 
     75    # and write the plugin's configuration 
     76    $self->config_write($config); 
    6777 
    6878    # let us parse some S29-functions.pod documentation (safely) 
  • trunk/Padre-Plugin-Perl6/lib/Padre/Plugin/Perl6/Perl6Document.pm

    r5366 r5367  
    2929} 
    3030 
    31 # a SLOW WAY to parse and colorize perl6 files 
     31# colorizes a Perl 6 document in a timer 
     32# one at a time; 
     33# now the user can choose between PGE and STD colorizers 
     34# via the preferences 
    3235sub colorize { 
    3336    my $self = shift; 
     
    4447                sub {  
    4548                    # temporary overlay using the parse tree given by parrot 
    46                     # TODO: let the user select which one to use 
    47                     my $colorizer = 'PGE'; 
     49                    my $colorizer = $config->{colorizer}; 
    4850                    my $task; 
    4951                    if($colorizer eq 'STD') { 
Note: See TracChangeset for help on using the changeset viewer.