ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/readline
Revision: 1.3
Committed: Fri Jan 20 22:49:34 2006 UTC (18 years, 4 months ago) by root
Branch: MAIN
Changes since 1.2: +13 -3 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 && !$self->current_screen) {
12 my $diff = $ofs - $cur;
13 my $move;
14
15 if ($diff < 0) {
16 ($ofs, $cur) = ($cur, $ofs);
17 $move = "\x1b[D";
18 } else {
19 $move = "\x1b[C";
20 }
21
22 my $skipped = substr $line->t, $cur, $ofs - $cur;
23 $skipped =~ s/$urxvt::NOCHAR//g;
24
25 $self->tt_write ($move x length $skipped);
26 }
27
28 ()
29 }