#! perl sub on_button_press { my ($self, $event) = @_; my ($row, $col) = $self->screen_cur; my $line = $self->line ($row); my $cur = $line->offset_of ($row, $col); my $ofs = $line->offset_of ($event->{row}, $event->{col}); if ($ofs >= 0 && $ofs < $line->l && !$self->current_screen) { my $diff = $ofs - $cur; my $move; if ($diff < 0) { ($ofs, $cur) = ($cur, $ofs); $move = "\x1b[D"; } else { $move = "\x1b[C"; } my $skipped = substr $line->t, $cur, $ofs - $cur; $skipped =~ s/$urxvt::NOCHAR//g; $self->tt_write ($move x length $skipped); } () }