Changeset 872


Ignore:
Timestamp:
11/10/08 13:10:18 (3 years ago)
Author:
szabgab
Message:

add new preference option for autoindenting

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Padre/Config.pm

    r861 r872  
    120120        editor_indentationguides  => 0, 
    121121        editor_calltips           => 1, 
     122        editor_autoindent         => 'deep', 
    122123 
    123124        # When running a script from the application some of the files might have not been saved yet. 
  • trunk/lib/Padre/Wx/Dialog/Preferences.pm

    r858 r872  
    1212 
    1313sub get_layout { 
    14     my ($config, $main_startup) = @_; 
     14    my ($config, $main_startup, $editor_autoindent) = @_; 
    1515 
    1616    return [ 
     
    3636        ], 
    3737        [ 
     38            [ 'Wx::StaticText', undef,              gettext('Autoindent:')], 
     39            [ 'Wx::Choice',     'editor_autoindent',    $editor_autoindent], 
     40        ], 
     41        [ 
    3842            [ 'Wx::Button',     '_ok_',           Wx::wxID_OK     ], 
    3943            [ 'Wx::Button',     '_cancel_',       Wx::wxID_CANCEL ], 
     
    4347 
    4448sub dialog { 
    45     my ($class, $win, $main_startup) = @_; 
     49    my ($class, $win, $main_startup, $editor_autoindent) = @_; 
    4650 
    4751    my $config = Padre->ide->config; 
    48     my $layout = get_layout($config, $main_startup); 
     52    my $layout = get_layout($config, $main_startup, $editor_autoindent); 
    4953    my $dialog = Padre::Wx::Dialog->new( 
    5054        parent => $win, 
     
    7478        grep { $_ ne $config->{main_startup} } qw( new nothing last ) 
    7579    ); 
     80    my @editor_autoindent = ( 
     81        $config->{editor_autoindent}, 
     82        grep { $_ ne $config->{editor_autoindent} } qw( no same_level deep ) 
     83    ); 
    7684 
    77     my $dialog = $class->dialog( $win, \@main_startup ); 
     85    my $dialog = $class->dialog( $win, \@main_startup, \@editor_autoindent ); 
    7886    return if not $dialog->show_modal; 
    7987 
  • trunk/t/02-new.t

    r865 r872  
    4141        editor_calltips    => 1, 
    4242        editor_use_tabs    => 1, 
     43        editor_autoindent  => 'deep', 
    4344 
    4445        search_terms       => [], 
Note: See TracChangeset for help on using the changeset viewer.