--- rxvt-unicode/src/perl/readline 2006/01/20 22:05:41 1.1 +++ rxvt-unicode/src/perl/readline 2006/01/22 11:57:06 1.5 @@ -3,6 +3,9 @@ sub on_button_press { my ($self, $event) = @_; + return + if $self->current_screen || $self->hidden_cursor; + my ($row, $col) = $self->screen_cur; my $line = $self->line ($row); my $cur = $line->offset_of ($row, $col); @@ -10,11 +13,19 @@ if ($ofs >= 0 && $ofs < $line->l) { my $diff = $ofs - $cur; + my $move; + + if ($diff < 0) { + ($ofs, $cur) = ($cur, $ofs); + $move = "\x1b[D"; + } else { + $move = "\x1b[C"; + } - $self->tt_write ($diff < 0 ? "\x1b[D" x -$diff - : "\x1b[C" x $diff); + my $skipped = substr $line->t, $cur, $ofs - $cur; + $skipped =~ s/\x{ffff}//g; - return 1; + $self->tt_write ($move x length $skipped); } ()