| 1 | Index: Padre/lib/Padre/Wx/Dialog/HelpSearch.pm |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- Padre/lib/Padre/Wx/Dialog/HelpSearch.pm (revision 8764) |
|---|
| 4 | +++ Padre/lib/Padre/Wx/Dialog/HelpSearch.pm (working copy) |
|---|
| 5 | @@ -61,6 +61,7 @@ |
|---|
| 6 | # |
|---|
| 7 | sub _display_help_in_viewer { |
|---|
| 8 | my $self = shift; |
|---|
| 9 | + my $special_case = 0; # for perl control structures that have no docs |
|---|
| 10 | |
|---|
| 11 | my ( $html, $location ); |
|---|
| 12 | my $selection = $self->_list->GetSelection(); |
|---|
| 13 | @@ -73,6 +74,7 @@ |
|---|
| 14 | warn "Error while calling help_render: $@\n"; |
|---|
| 15 | } |
|---|
| 16 | } |
|---|
| 17 | + $special_case = 1 if $topic =~ /for|foreach|while|until|if|unless/; |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | if ($html) { |
|---|
| 21 | @@ -80,6 +82,8 @@ |
|---|
| 22 | # Highlights <pre> code sections with a grey background |
|---|
| 23 | $html =~ s/<pre>/<table border="0" width="100%" bgcolor="#EEEEEE"><tr><td><pre>/ig; |
|---|
| 24 | $html =~ s/<\/pre>/<\/pre\><\/td><\/tr><\/table>/ig; |
|---|
| 25 | + } elsif ($special_case) { |
|---|
| 26 | + $html = '<b>' . Wx::gettext('Please look at perlsyn') . '</b>'; |
|---|
| 27 | } else { |
|---|
| 28 | $html = '<b>' . Wx::gettext('No Help found') . '</b>'; |
|---|
| 29 | } |
|---|
| 30 | @@ -90,6 +94,7 @@ |
|---|
| 31 | return; |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | + |
|---|
| 35 | # -- private methods |
|---|
| 36 | |
|---|
| 37 | # |
|---|
| 38 | Index: Padre/lib/Padre/HelpProvider/Perl.pm |
|---|
| 39 | =================================================================== |
|---|
| 40 | --- Padre/lib/Padre/HelpProvider/Perl.pm (revision 8764) |
|---|
| 41 | +++ Padre/lib/Padre/HelpProvider/Perl.pm (working copy) |
|---|
| 42 | @@ -122,6 +122,9 @@ |
|---|
| 43 | $Type{break} = 1; |
|---|
| 44 | push @index, keys %Type; |
|---|
| 45 | |
|---|
| 46 | + # Add Perl control structures |
|---|
| 47 | + push @index, qw/if unless for foreach while until/; |
|---|
| 48 | + |
|---|
| 49 | # Add CORE modules |
|---|
| 50 | # Note the 0 + $] to cast it to number |
|---|
| 51 | push @index, Module::CoreList->find_modules( qr//, 0 + $] ); |
|---|