*** empty log message ***
authorroot <root>
Mon, 20 Feb 2006 20:46:54 +0000 (20:46 +0000)
committerroot <root>
Mon, 20 Feb 2006 20:46:54 +0000 (20:46 +0000)
src/perl/readline

index b896c00bc3728ab895ea779212d64b3e22384546..ecd011fe892938f515a5a1af22d0197cec9ece20 100644 (file)
@@ -39,23 +39,24 @@ sub on_button_press {
    my $cur = $line->offset_of ($row, $col);
    my $ofs = $line->offset_of ($event->{row}, $event->{col});
 
-   $ofs >= 0 && $ofs < $line->l
-      or return;
+   if ($ofs >= 0 && $ofs < $line->l) {
+      my $diff = $ofs - $cur;
+      my $move;
 
-   my $diff = $ofs - $cur;
-   my $move;
+      if ($diff < 0) {
+         ($ofs, $cur) = ($cur, $ofs);
+         $move = "\x1b[D";
+      } else {
+         $move = "\x1b[C";
+      }
 
-   if ($diff < 0) {
-      ($ofs, $cur) = ($cur, $ofs);
-      $move = "\x1b[D";
-   } else {
-      $move = "\x1b[C";
-   }
+      my $skipped = substr $line->t, $cur, $ofs - $cur;
+      $skipped =~ s/\x{ffff}//g;
 
-   my $skipped = substr $line->t, $cur, $ofs - $cur;
-   $skipped =~ s/\x{ffff}//g;
+      $self->tt_write ($move x length $skipped);
 
-   $self->tt_write ($move x length $skipped);
+      return 1;
+   }
 
-   1
+   ()
 }