Changeset 11120


Ignore:
Timestamp:
03/15/10 04:51:54 (2 years ago)
Author:
azawawi
Message:

Perl tidy (25 files)

Location:
trunk/Padre
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Action/Edit.pm

    r11105 r11120  
    319319        }, 
    320320    ); 
    321      
     321 
    322322    Padre::Action->new( 
    323323        name        => 'edit.brace_match_select', 
  • trunk/Padre/lib/Padre/Action/Tools.pm

    r11108 r11120  
    253253    # Find 'cpanm', used to install modules 
    254254    require Config; 
    255     my %seen  = (); 
    256     my @where = grep { 
    257         defined $_ and length $_ and not $seen{$_}++ 
    258     } map { 
    259         $Config::Config{$_} 
    260     } qw{ 
     255    my %seen = (); 
     256    my @where = grep { defined $_ and length $_ and not $seen{$_}++ } map { $Config::Config{$_} } qw{ 
    261257        sitescriptexp 
    262258        sitebinexp 
     
    267263    }; 
    268264    my $cpanm = ''; 
    269     foreach my $dir ( @where ) { 
     265 
     266    foreach my $dir (@where) { 
    270267        my $path = File::Spec->catfile( $dir, 'cpanm' ); 
    271268        if ( -f $path ) { 
     
    274271        } 
    275272    } 
    276     unless ( $cpanm ) { 
     273    unless ($cpanm) { 
    277274        $main->error( Wx::gettext("cpanm is unexpectedly not installed") ); 
    278275        return; 
  • trunk/Padre/lib/Padre/Document/Perl.pm

    r11112 r11120  
    346346# Implemented as a task. See Padre::Task::SyntaxChecker::Perl 
    347347sub check_syntax { 
    348     shift->_check_syntax_internals( { @_, 
    349         background => 0 } ); 
     348    shift->_check_syntax_internals( 
     349        {   @_, 
     350            background => 0 
     351        } 
     352    ); 
    350353} 
    351354 
    352355sub check_syntax_in_background { 
    353     shift->_check_syntax_internals( { @_, 
    354         background => 1 } ); 
     356    shift->_check_syntax_internals( 
     357        {   @_, 
     358            background => 1 
     359        } 
     360    ); 
    355361} 
    356362 
     
    12941300    my $first  = $editor->PositionFromLine($line); 
    12951301    my $col    = $pos - $first; 
    1296     my $text   = $editor->GetTextRange($first, $pos); 
     1302    my $text   = $editor->GetTextRange( $first, $pos ); 
    12971303 
    12981304    $editor->AddText( $self->newline ); 
     
    13011307    $editor->AddText($text); 
    13021308 
    1303     $editor->SetCurrentPos( $pos + $col + 1); 
     1309    $editor->SetCurrentPos( $pos + $col + 1 ); 
    13041310 
    13051311    return 1; 
  • trunk/Padre/lib/Padre/Locale.pm

    r11084 r11120  
    6868    my $name = shift; 
    6969    require Encode; 
    70     return $RFC4646{$name}{utf8text} ? Encode::decode('utf8', $RFC4646{$name}{utf8text}) : $name 
     70    return $RFC4646{$name}{utf8text} ? Encode::decode( 'utf8', $RFC4646{$name}{utf8text} ) : $name; 
    7171} 
    7272 
  • trunk/Padre/lib/Padre/Plugin/Devel.pm

    r11089 r11120  
    189189 
    190190    foreach ( 0 .. $count - 1 ) { 
    191         my $display  = Wx::Display->new($_); 
     191        my $display = Wx::Display->new($_); 
    192192        push @displays, 
    193193            { 
    194194            IsPrimary     => $display->IsPrimary, 
    195             GetGeometry   => $self->_rect($display->GetGeometry), 
    196             GetClientArea => $self->_rect($display->GetClientArea), 
     195            GetGeometry   => $self->_rect( $display->GetGeometry ), 
     196            GetClientArea => $self->_rect( $display->GetClientArea ), 
    197197            }; 
    198198    } 
    199199    $self->_dump( 
    200         {  GetCount    => $count, 
     200        {   GetCount    => $count, 
    201201            DisplayList => \@displays, 
    202202        } 
     
    207207    my $self = shift; 
    208208    my $rect = shift; 
    209     my %hash = map { 
    210         $_ => $rect->$_() 
    211     } qw{ 
     209    my %hash = map { $_ => $rect->$_() } qw{ 
    212210        GetTop 
    213211        GetBottom 
  • trunk/Padre/lib/Padre/SlaveDriver.pm

    r11064 r11120  
    128128 
    129129    require Storable; 
    130     $self->{cmd_queue}->enqueue( 
    131         Storable::freeze( [ $manager->task_queue ] ) 
    132     ); 
    133  
    134     return threads->object( 
    135         $self->{tid_queue}->dequeue 
    136     ); 
     130    $self->{cmd_queue}->enqueue( Storable::freeze( [ $manager->task_queue ] ) ); 
     131 
     132    return threads->object( $self->{tid_queue}->dequeue ); 
    137133} 
    138134 
     
    243239    while ( my $args = $in->dequeue ) { # args is frozen [$main, $queue] 
    244240        last if $args eq 'STOP'; 
    245         my $queue  = Padre::SlaveDriver->new->task_queue; 
     241        my $queue = Padre::SlaveDriver->new->task_queue; 
    246242        my $worker = threads->create( \&_worker_loop, $queue ); 
    247243        $out->enqueue( $worker->tid ); 
  • trunk/Padre/lib/Padre/Task/Outline/Perl.pm

    r11115 r11120  
    271271    if ( defined( $pkg->{$type} ) && scalar( @{ $pkg->{$type} } ) > 0 ) { 
    272272        my $type_caption = ucfirst($type); 
    273         if (exists $type_caption{$type}) { 
     273        if ( exists $type_caption{$type} ) { 
    274274            $type_caption = $type_caption{$type}; 
    275         } 
    276         else { 
     275        } else { 
    277276            warn "Type not translated: $type_caption\n"; 
    278277        } 
    279          
     278 
    280279        $type_elem = $outlinebar->AppendItem( 
    281280            $root, 
  • trunk/Padre/lib/Padre/TaskManager.pm

    r11102 r11120  
    426426    $self->task_queue->insert( 0, ("STOP") x scalar(@workers) ); 
    427427 
    428     my $waitstart = [gettimeofday()]; 
     428    my $waitstart = [ gettimeofday() ]; 
    429429 
    430430    # Changing the selection seems to solve the endless-loop problem 
     
    436436 
    437437        # Wait no more than two minutes 
    438         last    if( tv_interval($waitstart) >= (2*60) ); 
     438        last if ( tv_interval($waitstart) >= ( 2 * 60 ) ); 
    439439 
    440440        # Pass time slices to the threads for finishing 
  • trunk/Padre/lib/Padre/Wx/About.pm

    r11086 r11120  
    9898 
    9999    # Create the content for the About window 
    100     my $self   = shift; 
    101     my $splash = Padre::Util::splash(); 
     100    my $self               = shift; 
     101    my $splash             = Padre::Util::splash(); 
    102102    my $created_by         = Wx::gettext('Created by'); 
    103103    my $padre_dev_team     = Wx::gettext('The Padre Development Team'); 
  • trunk/Padre/lib/Padre/Wx/App.pm

    r11064 r11120  
    5050    my $ide = shift; 
    5151    require Params::Util; 
    52     unless ( Params::Util::_INSTANCE($ide, 'Padre') ) { 
     52    unless ( Params::Util::_INSTANCE( $ide, 'Padre' ) ) { 
    5353        Carp::croak("Did not provide the ide object to Padre::App->create"); 
    5454    } 
  • trunk/Padre/lib/Padre/Wx/AuiManager.pm

    r11099 r11120  
    6565# Set the lock status of the panels 
    6666sub lock_panels { 
    67     my $self   = shift; 
     67    my $self = shift; 
    6868    my $unlock = $_[0] ? 0 : 1; 
    6969 
  • trunk/Padre/lib/Padre/Wx/Dialog/HelpSearch.pm

    r11117 r11120  
    393393        $self->_list->Select(0); 
    394394    } 
    395     $self->_status->SetLabel( sprintf(Wx::gettext("Found %s help topic(s)\n"), $pos) ); 
     395    $self->_status->SetLabel( sprintf( Wx::gettext("Found %s help topic(s)\n"), $pos ) ); 
    396396    $self->_display_help_in_viewer; 
    397397 
  • trunk/Padre/lib/Padre/Wx/Dialog/OpenResource.pm

    r11113 r11120  
    261261    ); 
    262262    $self->_popup_menu( Wx::Menu->new ); 
    263     $self->_skip_vcs_files( $self->_popup_menu->AppendCheckItem( -1, Wx::gettext("Skip version control system files") ) ); 
     263    $self->_skip_vcs_files( 
     264        $self->_popup_menu->AppendCheckItem( -1, Wx::gettext("Skip version control system files") ) ); 
    264265    $self->_skip_using_manifest_skip( 
    265266        $self->_popup_menu->AppendCheckItem( -1, Wx::gettext("Skip using MANIFEST.SKIP") ) ); 
  • trunk/Padre/lib/Padre/Wx/Dialog/Replace.pm

    r11114 r11120  
    572572    my $number_of_changes = $main->replace_all($search); 
    573573    if ($number_of_changes) { 
    574         my $message_text = $number_of_changes == 1 ? Wx::gettext('Replaced %d match') : Wx::gettext('Replaced %d matches'); 
     574        my $message_text = 
     575            $number_of_changes == 1 ? Wx::gettext('Replaced %d match') : Wx::gettext('Replaced %d matches'); 
     576 
    575577        # remark: It would be better to use gettext for plural handling, but wxperl does not seem to support this at the moment. 
    576578        $main->info( 
    577             sprintf($message_text,  $number_of_changes), 
     579            sprintf( $message_text, $number_of_changes ), 
    578580            Wx::gettext('Search and Replace') 
    579581        ); 
  • trunk/Padre/lib/Padre/Wx/Dialog/SpecialValues.pm

    r11110 r11120  
    1414my $categories = { 
    1515    Wx::gettext('Date/Time') => [ 
    16         { label => Wx::gettext('Now'),       action => _get_date_info('now') }, 
    17         { label => Wx::gettext('Today'),     action => _get_date_info('today') }, 
    18         { label => Wx::gettext('Year'),      action => _get_date_info('year') }, 
    19         { label => Wx::gettext('Epoch'),     action => _get_date_info('epoch') }, 
     16        { label => Wx::gettext('Now'),   action => _get_date_info('now') }, 
     17        { label => Wx::gettext('Today'), action => _get_date_info('today') }, 
     18        { label => Wx::gettext('Year'),  action => _get_date_info('year') }, 
     19        { label => Wx::gettext('Epoch'), action => _get_date_info('epoch') }, 
    2020    ], 
    2121    Wx::gettext('File') => [ 
     
    9292    my $value_ind = $data->{_find_specialvalue_}; 
    9393    my $text      = &{ $categories->{$cat_name}[$value_ind]{action} }; 
     94 
    9495    #warn "cat : $cat_name, value $value_ind, text : $text\n"; 
    9596 
     
    123124        return sub { 
    124125            return scalar localtime; 
    125         } 
    126     } 
    127     elsif ( $type eq 'today' ) { 
     126            } 
     127    } elsif ( $type eq 'today' ) { 
    128128        return sub { 
    129129            my @localtime = localtime(time); 
    130130            return sprintf "%s-%02s-%02s", $localtime[5] + 1900, $localtime[4], $localtime[3]; 
    131         } 
    132     } 
    133     elsif ( $type eq 'year' ) { 
     131            } 
     132    } elsif ( $type eq 'year' ) { 
    134133        return sub { 
    135134            my @localtime = localtime(time); 
    136135            return $localtime[5] + 1900; 
    137         } 
    138     } 
    139     elsif ( $type eq 'epoch' ) { 
     136            } 
     137    } elsif ( $type eq 'epoch' ) { 
    140138        return sub { 
    141139            return time; 
    142         } 
    143     } 
    144     else { 
     140            } 
     141    } else { 
    145142        return sub { 
    146143            warn "date info $type not implemented yet\n"; 
    147144            return ''; 
    148         } 
     145            } 
    149146    } 
    150147} 
    151148 
    152149sub _get_file_info { 
    153     my $type = shift; 
     150    my $type     = shift; 
    154151    my $document = Padre::Current->document; 
    155     my ( $lines, $chars_with_space, $chars_without_space, $words, $is_readonly, 
    156          $filename, $newline_type, $encoding ) = $document->stats; 
    157      
     152    my ($lines,    $chars_with_space, $chars_without_space, $words, $is_readonly, 
     153        $filename, $newline_type,     $encoding 
     154    ) = $document->stats; 
     155 
    158156    if ( $type eq 'name' ) { 
    159157        return sub { 
    160158            return defined $filename ? $filename : Wx::gettext("No filename"); 
    161159        }; 
    162     } 
    163     elsif ( $type eq 'size' ) { 
     160    } elsif ( $type eq 'size' ) { 
    164161        return sub { 
    165162            my $filename = $document->filename || $document->tempfile; 
    166163            return ($filename) ? -s $filename : 0; 
    167164        }; 
    168     } 
    169     elsif ( $type eq 'number of lines' ) { 
     165    } elsif ( $type eq 'number of lines' ) { 
    170166        return sub { 
    171167            return $lines; 
    172168        }; 
    173     } 
    174     else { 
     169    } else { 
    175170        return sub { 
    176171            warn "file info $type not implemented yet\n"; 
    177172            return ''; 
    178         } 
     173            } 
    179174    } 
    180175} 
  • trunk/Padre/lib/Padre/Wx/Dialog/WhereFrom.pm

    r11119 r11120  
    99our $VERSION = '0.58'; 
    1010 
    11 our @ISA     = qw{ 
     11our @ISA = qw{ 
    1212    Padre::Wx::Role::MainChild 
    1313    Wx::Dialog 
     
    1818 
    1919    my $config = Padre->ide->config; 
     20 
    2021    #return if $config->feedback_done; 
    2122 
     
    5455 
    5556sub _create_controls { 
    56     my ($dialog, $sizer) = @_; 
     57    my ( $dialog, $sizer ) = @_; 
    5758 
    5859    # "Where did you hear..." label 
    59     my $wherefrom_label = Wx::StaticText->new(  
    60         $dialog,  
    61         -1,  
     60    my $wherefrom_label = Wx::StaticText->new( 
     61        $dialog, 
     62        -1, 
    6263        Wx::gettext('Where did you hear about Padre?') 
    6364    ); 
     
    7374        Wx::gettext('Other (Please fill in here)'), 
    7475    ]; 
    75      
    76     $dialog->{wherefrom} = Wx::ComboBox->new(  
    77         $dialog,  
    78         -1,  
    79         '',  
     76 
     77    $dialog->{wherefrom} = Wx::ComboBox->new( 
     78        $dialog, 
     79        -1, 
     80        '', 
    8081        Wx::wxDefaultPosition, 
    8182        Wx::wxDefaultSize, 
    8283        $choices 
    8384    ); 
    84      
     85 
    8586    # OK button 
    8687    $dialog->{button_ok} = Wx::Button->new( 
     
    9192    # Cancel button 
    9293    $dialog->{button_cancel} = Wx::Button->new( 
    93         $dialog, Wx::wxID_CANCEL,  
     94        $dialog, Wx::wxID_CANCEL, 
    9495        Wx::gettext("Skip question without giving feedback"), 
    9596    ); 
    96      
     97 
    9798    # where from...? sizer 
    9899    my $wherefrom_sizer = Wx::BoxSizer->new(Wx::wxHORIZONTAL); 
     
    103104    # Button sizer 
    104105    my $button_sizer = Wx::BoxSizer->new(Wx::wxHORIZONTAL); 
    105     $button_sizer->Add( $dialog->{button_ok},   0, 0,          0 ); 
     106    $button_sizer->Add( $dialog->{button_ok},     0, 0,          0 ); 
    106107    $button_sizer->Add( $dialog->{button_cancel}, 0, Wx::wxLEFT, 5 ); 
    107108    $button_sizer->AddSpacer(5); 
     
    116117    # Wrap with a horizontal sizer to get left/right padding 
    117118    $sizer->Add( $vsizer, 1, Wx::wxALL | Wx::wxEXPAND, 5 ); 
    118      
     119 
    119120    return; 
    120121} 
     
    123124sub _bind_events { 
    124125    my $dialog = shift; 
    125      
     126 
    126127    # Ok button 
    127     Wx::Event::EVT_BUTTON(  
    128         $dialog,  
    129         $dialog->{button_ok},      
    130         \&WhereFrom_ok_clicked  
     128    Wx::Event::EVT_BUTTON( 
     129        $dialog, 
     130        $dialog->{button_ok}, 
     131        \&WhereFrom_ok_clicked 
    131132    ); 
    132      
     133 
    133134    # Cancel or Skip feedback button 
    134     Wx::Event::EVT_BUTTON(  
    135         $dialog,  
    136         $dialog->{button_cancel},  
     135    Wx::Event::EVT_BUTTON( 
     136        $dialog, 
     137        $dialog->{button_cancel}, 
    137138        \&WhereFrom_cancel_clicked 
    138139    ); 
  • trunk/Padre/lib/Padre/Wx/Dialog/WindowList.pm

    r11066 r11120  
    358358            $disk_text = Wx::gettext('CHANGED'); 
    359359        } 
    360         $list->SetItem( $idx, 3, $disk_text); 
     360        $list->SetItem( $idx, 3, $disk_text ); 
    361361    } 
    362362 
  • trunk/Padre/lib/Padre/Wx/Display.pm

    r11098 r11120  
    103103    my $rect   = shift; 
    104104    my $ratio  = shift; 
    105     my $margin = (1 - $ratio) / 2; 
     105    my $margin = ( 1 - $ratio ) / 2; 
    106106    $rect->width( int( $rect->width * $ratio ) ); 
    107107    $rect->height( int( $rect->height * $ratio ) ); 
    108     $rect->x( $rect->x + int($rect->width  * $margin) ); 
    109     $rect->y( $rect->y + int($rect->height * $margin) ); 
     108    $rect->x( $rect->x + int( $rect->width * $margin ) ); 
     109    $rect->y( $rect->y + int( $rect->height * $margin ) ); 
    110110    return $rect; 
    111111} 
     
    116116    my $rect    = shift; 
    117117    my $ratio   = shift; 
    118     my $marginr = (1 - $ratio) / 2; 
    119     my $marginx = int($rect->width  * $marginr); 
    120     my $marginy = int($rect->height * $marginr); 
    121     my $margin  = ($marginx > $marginy) ? $marginy : $marginx; 
     118    my $marginr = ( 1 - $ratio ) / 2; 
     119    my $marginx = int( $rect->width * $marginr ); 
     120    my $marginy = int( $rect->height * $marginr ); 
     121    my $margin  = ( $marginx > $marginy ) ? $marginy : $marginx; 
    122122    $rect->width( $rect->width - $margin * 2 ); 
    123123    $rect->height( $rect->height - $margin * 2 ); 
     
    130130sub _rect_golden { 
    131131    my $rect = shift; 
    132     if ( $rect->width > ($rect->height * GOLDEN) ) { 
     132    if ( $rect->width > ( $rect->height * GOLDEN ) ) { 
     133 
    133134        # Shrink left from the right 
    134         $rect->width( int($rect->height / GOLDEN) ); 
     135        $rect->width( int( $rect->height / GOLDEN ) ); 
    135136    } else { 
     137 
    136138        # Shrink up from the bottom 
    137         $rect->height( int($rect->width / GOLDEN) ); 
     139        $rect->height( int( $rect->width / GOLDEN ) ); 
    138140    } 
    139141    return $rect; 
  • trunk/Padre/lib/Padre/Wx/DocBrowser.pm

    r11117 r11120  
    111111        Wx::wxTE_PROCESS_ENTER 
    112112    ); 
    113     $entry->SetToolTip( Wx::ToolTip->new(Wx::gettext('Search for perldoc - e.g. Padre::Task, Net::LDAP')) ); 
     113    $entry->SetToolTip( Wx::ToolTip->new( Wx::gettext('Search for perldoc - e.g. Padre::Task, Net::LDAP') ) ); 
    114114 
    115115    Wx::Event::EVT_TEXT_ENTER( 
     
    128128        Wx::wxALIGN_RIGHT 
    129129    ); 
    130     $label->SetToolTip( Wx::ToolTip->new(Wx::gettext('Search for perldoc - e.g. Padre::Task, Net::LDAP')) ); 
     130    $label->SetToolTip( Wx::ToolTip->new( Wx::gettext('Search for perldoc - e.g. Padre::Task, Net::LDAP') ) ); 
    131131 
    132132    my $close_button = Wx::Button->new( $self, Wx::wxID_CANCEL, Wx::gettext('&Close') ); 
     
    369369            $panel; 
    370370        } else { 
    371             $self->debug( sprintf(Wx::gettext('DocBrowser: no viewer for %s'), $mime) ); 
     371            $self->debug( sprintf( Wx::gettext('DocBrowser: no viewer for %s'), $mime ) ); 
    372372        } 
    373373    }; 
     
    402402    my $notFound = Wx::MessageDialog->new( 
    403403        $self, 
    404         sprintf(Wx::gettext("Searched for '%s' and failed..."), $query), 
     404        sprintf( Wx::gettext("Searched for '%s' and failed..."), $query ), 
    405405        Wx::gettext('Help not found.'), 
    406406        wxOK | wxCENTRE | wxICON_INFORMATION 
  • trunk/Padre/lib/Padre/Wx/Editor.pm

    r11106 r11120  
    4444# Brace* methods 
    4545# always altern opening and starting braces in the constant 
    46 my $BRACES = '{}[]()'; 
    47 my $STC_INVALID_POSITION =  Wx::wxSTC_INVALID_POSITION; 
     46my $BRACES               = '{}[]()'; 
     47my $STC_INVALID_POSITION = Wx::wxSTC_INVALID_POSITION; 
    4848 
    4949my $data; 
     
    169169# return the character at a given position as a perl string 
    170170sub get_character_at { 
    171     my ($self, $pos) = @_; 
     171    my ( $self, $pos ) = @_; 
    172172    return chr( $self->GetCharAt($pos) ); 
    173173} 
     
    424424 
    425425 
    426      
    427      
    428  
    429426 
    430427 
     
    456453 
    457454sub get_brace_info { 
    458     my ($self, $pos) = @_; 
     455    my ( $self, $pos ) = @_; 
    459456    $pos = $self->GetCurrentPos unless defined $pos; 
    460       
     457 
    461458    # try the after position first (default one for BraceMatch) 
    462459    my $is_after = 1; 
    463     my $brace = $self->get_character_at($pos); 
     460    my $brace    = $self->get_character_at($pos); 
    464461    my $is_brace = $self->get_brace_type($brace); 
    465     if (!$is_brace && $pos > 0) { # try the before position 
    466         $brace = $self->get_character_at(--$pos); 
    467         $is_brace  = $self->get_brace_type($brace) or return undef; 
     462    if ( !$is_brace && $pos > 0 ) { # try the before position 
     463        $brace    = $self->get_character_at( --$pos ); 
     464        $is_brace = $self->get_brace_type($brace) or return undef; 
    468465        $is_after = 0; 
    469466    } 
    470467    my $is_opening = $is_brace % 2; # odd values are opening 
    471     return [$pos, $brace, $is_after, $is_opening]; 
     468    return [ $pos, $brace, $is_after, $is_opening ]; 
    472469} 
    473470 
     
    485482 
    486483=cut 
     484 
    487485my %_cached_braces; 
     486 
    488487sub get_brace_type { 
    489     my ($self, $char) = @_; 
     488    my ( $self, $char ) = @_; 
    490489    unless (%_cached_braces) { 
    491490        my $i = 1; # start from one so that all values are true 
    492         $_cached_braces{$_} = $i++ foreach (split //, $BRACES); 
     491        $_cached_braces{$_} = $i++ foreach ( split //, $BRACES ); 
    493492    } 
    494493    my $v = $_cached_braces{$char} or return 0; 
     
    501500# {} : never highlighted 
    502501# { } : always correct 
    503 #  
    504502# 
     503# 
    505504 
    506505sub apply_style { 
    507     my ($self, $style_info) = @_; 
     506    my ( $self, $style_info ) = @_; 
    508507    my %previous_style = %$style_info; 
    509     $previous_style{style} = $self->GetStyleAt($style_info->{start}); 
    510      
     508    $previous_style{style} = $self->GetStyleAt( $style_info->{start} ); 
     509 
    511510    $self->StartStyling( $style_info->{start}, 0xFF ); 
    512511    $self->SetStyling( $style_info->{len}, $style_info->{style} ); 
    513      
     512 
    514513    return \%previous_style; 
    515514} 
     
    517516 
    518517my $previous_expr_hiliting_style; 
     518 
    519519sub highlight_braces { 
    520520    my ($self) = @_; 
    521      
     521 
    522522    my $expression_highlighting = $self->get_config->editor_brace_expression_highlighting; 
    523      
     523 
    524524    # remove current highlighting if any 
    525     $self->BraceHighlight( $STC_INVALID_POSITION, $STC_INVALID_POSITION  ); 
     525    $self->BraceHighlight( $STC_INVALID_POSITION, $STC_INVALID_POSITION ); 
    526526    if ($previous_expr_hiliting_style) { 
    527527        $self->apply_style($previous_expr_hiliting_style); 
    528528        $previous_expr_hiliting_style = undef; 
    529529    } 
    530      
    531     my $pos1 = $self->GetCurrentPos; 
    532     my $info1 = $self->get_brace_info($pos1) or return; 
     530 
     531    my $pos1          = $self->GetCurrentPos; 
     532    my $info1         = $self->get_brace_info($pos1) or return; 
    533533    my ($actual_pos1) = @$info1; 
    534      
     534 
    535535    my $actual_pos2 = $self->BraceMatch($actual_pos1); 
    536 #   return if abs( $pos1 - $pos2 ) < 2; 
     536 
     537    #   return if abs( $pos1 - $pos2 ) < 2; 
    537538 
    538539    return if $actual_pos2 == $STC_INVALID_POSITION; #Wx::wxSTC_INVALID_POSITION  #???? 
    539540 
    540541    $self->BraceHighlight( $actual_pos1, $actual_pos2 ); 
    541      
     542 
    542543    if ($expression_highlighting) { 
    543         my $pos2  = $self->find_matching_brace($pos1) or return; 
    544         my %style = (start => $pos1 < $pos2 ? $pos1 : $pos2,  
    545             len => abs($pos1-$pos2), style => Wx::wxSTC_STYLE_DEFAULT); 
    546         $previous_expr_hiliting_style = $self->apply_style(\%style); 
     544        my $pos2 = $self->find_matching_brace($pos1) or return; 
     545        my %style = ( 
     546            start => $pos1 < $pos2 ? $pos1 : $pos2, 
     547            len => abs( $pos1 - $pos2 ), style => Wx::wxSTC_STYLE_DEFAULT 
     548        ); 
     549        $previous_expr_hiliting_style = $self->apply_style( \%style ); 
    547550    } 
    548551 
     
    564567 
    565568=cut 
     569 
    566570sub find_matching_brace { 
    567     my ($self, $pos) = @_; 
     571    my ( $self, $pos ) = @_; 
    568572    $pos = $self->GetCurrentPos unless defined $pos; 
    569573    my $info1 = $self->get_brace_info($pos) or return; 
    570     my ($actual_pos1, $brace, $is_after, $is_opening) = @$info1; 
    571      
     574    my ( $actual_pos1, $brace, $is_after, $is_opening ) = @$info1; 
     575 
    572576    my $actual_pos2 = $self->BraceMatch($actual_pos1); 
    573577    return if $actual_pos2 == $STC_INVALID_POSITION; 
     
    587591 
    588592=cut 
     593 
    589594sub goto_matching_brace { 
    590     my ($self, $pos) = @_; 
    591     my $pos2  = $self->find_matching_brace($pos) or return; 
     595    my ( $self, $pos ) = @_; 
     596    my $pos2 = $self->find_matching_brace($pos) or return; 
    592597    $self->GotoPos($pos2); 
    593598} 
     
    606611 
    607612sub select_to_matching_brace { 
    608     my ($self, $pos) = @_; 
     613    my ( $self, $pos ) = @_; 
    609614    $pos = $self->GetCurrentPos unless defined $pos; 
    610     my $pos2  = $self->find_matching_brace($pos) or return; 
    611     my $start = ($pos < $pos2) ? $self->GetSelectionStart() : $self->GetSelectionEnd(); 
    612     $self->SetSelection($start, $pos2); 
    613          
    614 } 
    615          
     615    my $pos2 = $self->find_matching_brace($pos) or return; 
     616    my $start = ( $pos < $pos2 ) ? $self->GetSelectionStart() : $self->GetSelectionEnd(); 
     617    $self->SetSelection( $start, $pos2 ); 
     618 
     619} 
     620 
    616621# currently if there are 9 lines we set the margin to 1 width and then 
    617622# if another line is added it is not seen well. 
  • trunk/Padre/lib/Padre/Wx/Main.pm

    r11105 r11120  
    109109    # the previous size is completely suspect. 
    110110    if ( $config->main_maximized ) { 
    111         $style   |= Wx::wxMAXIMIZE; 
     111        $style |= Wx::wxMAXIMIZE; 
    112112        $size     = [ -1, -1 ]; 
    113113        $position = [ -1, -1 ]; 
     
    117117    if ( $size->[0] == -1 ) { 
    118118        require Padre::Wx::Display; 
    119         my $rect  = Padre::Wx::Display::primary_default(); 
     119        my $rect = Padre::Wx::Display::primary_default(); 
    120120        $size     = $rect->GetSize; 
    121121        $position = $rect->GetPosition; 
     
    352352    $manager->alert_new; 
    353353 
    354     unless ( $Padre::Test::VERSION ) { 
     354    unless ($Padre::Test::VERSION) { 
    355355        require Padre::Wx::Dialog::WhereFrom; 
    356356        Padre::Wx::Dialog::WhereFrom->new($self); 
  • trunk/Padre/lib/Padre/Wx/Menu/Edit.pm

    r11110 r11120  
    163163        'edit.brace_match', 
    164164    ); 
    165      
     165 
    166166    $self->{brace_match_select} = $self->add_menu_action( 
    167167        $self, 
  • trunk/Padre/lib/Padre/Wx/Right.pm

    r11099 r11120  
    1616 
    1717sub new { 
    18     my $class = shift; 
    19     my $main  = shift; 
    20     my $aui   = $main->aui; 
     18    my $class  = shift; 
     19    my $main   = shift; 
     20    my $aui    = $main->aui; 
    2121    my $unlock = $main->config->main_lockinterface ? 0 : 1; 
    2222 
  • trunk/Padre/t/07-version.t

    r11072 r11120  
    1010# Search for Padre version 
    1111use_ok('Padre'); 
    12 ok($Padre::VERSION,'Check Padre module version'); 
     12ok( $Padre::VERSION, 'Check Padre module version' ); 
    1313 
    1414my $ext_vers = `$^X script/padre --version`; 
    15 like($ext_vers,qr/Perl Application Development and Refactoring Environment/,'Version string text'); 
    16 like($ext_vers,qr/$Padre::VERSION/,'Version number'); 
     15like( $ext_vers, qr/Perl Application Development and Refactoring Environment/, 'Version string text' ); 
     16like( $ext_vers, qr/$Padre::VERSION/, 'Version number' ); 
Note: See TracChangeset for help on using the changeset viewer.