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

File Contents

# User Rev Content
1 root 1.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     return 1;
18     }
19    
20     ()
21     }