ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/readline
Revision: 1.2
Committed: Fri Jan 20 22:07:08 2006 UTC (18 years, 4 months ago) by root
Branch: MAIN
Changes since 1.1: +0 -2 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #! perl
2
3 sub on_button_press {
4 my ($self, $event) = @_;
5
6 my ($row, $col) = $self->screen_cur;
7 my $line = $self->line ($row);
8 my $cur = $line->offset_of ($row, $col);
9 my $ofs = $line->offset_of ($event->{row}, $event->{col});
10
11 if ($ofs >= 0 && $ofs < $line->l) {
12 my $diff = $ofs - $cur;
13
14 $self->tt_write ($diff < 0 ? "\x1b[D" x -$diff
15 : "\x1b[C" x $diff);
16 }
17
18 ()
19 }