Changeset 5612
- Timestamp:
- 06/26/09 13:16:45 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre-Plugin-PerlTidy/lib/Padre/Plugin/PerlTidy.pm
r5590 r5612 24 24 use Padre::Wx (); 25 25 use Padre::Plugin (); 26 27 our $VERSION = '0.07'; 26 use constant { SELECTIONSIZE => 40, }; # this constant is used when storing 27 # and restoring the cursor position. 28 # Keep it small to limit resource use. 29 our $VERSION = '0.07'; 28 30 our @ISA = 'Padre::Plugin'; 29 31 … … 231 233 # parameter: $main, compiled regex 232 234 my ( $main, $regex, $start ) = @_; 233 my $shuffle = 40;234 235 my $doc = $main->current->document; 235 236 my $editor = $doc->editor; 236 237 my $text = $editor->GetTextRange( 237 ( $start - $shuffle ) > 0 ? $start - $shuffle238 ( $start - SELECTIONSIZE ) > 0 ? $start - SELECTIONSIZE 238 239 : 0, 239 ( $start + $shuffle < $editor->GetLength() ) ? $start + $shuffle240 ( $start + SELECTIONSIZE < $editor->GetLength() ) ? $start + SELECTIONSIZE 240 241 : $editor->GetLength() 241 242 ); … … 260 261 my $editor = $doc->editor; 261 262 my $pos = $editor->GetCurrentPos; 262 263 # A smaller selection to save memory264 my $sel_width = 40; # chars before265 263 my $start; 266 264 267 if ( ( $pos - $sel_width) > 0 ) {268 $start = $pos - $sel_width;265 if ( ( $pos - SELECTIONSIZE ) > 0 ) { 266 $start = $pos - SELECTIONSIZE; 269 267 } 270 268 else {
Note: See TracChangeset
for help on using the changeset viewer.
