Changeset 6700c605 for perl/lib/BarnOwl.pm
- Timestamp:
- Dec 24, 2009, 6:18:51 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 980fa31
- Parents:
- c471e85
- git-author:
- Alex Dehnert <adehnert@mit.edu> (12/20/09 01:50:12)
- git-committer:
- Alex Dehnert <adehnert@mit.edu> (12/24/09 18:18:51)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl.pm
r1b9a163 r6700c605 38 38 use BarnOwl::Completion; 39 39 40 use List::Util qw(max); 41 40 42 =head1 NAME 41 43 … … 421 423 }); 422 424 425 # Receive window scrolling 426 BarnOwl::new_command("recv:shiftleft", 427 \&BarnOwl::recv_shift_left, 428 { 429 summary => "scrolls receive window to the left", 430 usage => "recv:shiftleft [<amount>]", 431 description => <<END_DESCR 432 By default, scroll left by 10 columns. Passing no arguments or 0 activates this default behavior. 433 Otherwise, scroll by the number of columns specified as the argument. 434 END_DESCR 435 }); 436 437 BarnOwl::new_command("recv:shiftright", 438 \&BarnOwl::recv_shift_right, 439 { 440 summary => "scrolls receive window to the right", 441 usage => "recv:shiftright [<amount>]", 442 description => <<END_DESCR 443 By default, scroll right by 10 columns. Passing no arguments or 0 activates this default behavior. 444 Otherwise, scroll by the number of columns specified as the argument. 445 END_DESCR 446 }); 447 423 448 } 424 449 … … 485 510 } 486 511 512 =head3 Receive window scrolling 513 514 Permit scrolling the receive window left or right by arbitrary 515 amounts (with a default of 10 characters). 516 517 =cut 518 519 sub recv_shift_left 520 { 521 my $func = shift; 522 my $delta = shift; 523 $delta = 10 unless int($delta) > 0; 524 my $shift = BarnOwl::recv_getshift(); 525 if($shift > 0) { 526 BarnOwl::recv_setshift(max(0, $shift-$delta)); 527 } else { 528 return "Already full left"; 529 } 530 } 531 532 sub recv_shift_right 533 { 534 my $func = shift; 535 my $delta = shift; 536 $delta = 10 unless int($delta) > 0; 537 my $shift = BarnOwl::recv_getshift(); 538 BarnOwl::recv_setshift($shift+$delta); 539 } 540 487 541 =head3 default_zephyr_signature 488 542
Note: See TracChangeset
for help on using the changeset viewer.