ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/readline
(Generate patch)

Comparing rxvt-unicode/src/perl/readline (file contents):
Revision 1.4 by root, Sat Jan 21 08:07:39 2006 UTC vs.
Revision 1.7 by root, Mon Feb 6 06:14:08 2006 UTC

1#! perl 1#! perl
2
3use POSIX ();
4
5my $termios = new POSIX::Termios;
6
7sub on_init {
8 my ($self) = @_;
9
10 $self->{enabled} = 1;
11
12 push @{ $self->{term}{option_popup_hook} }, sub {
13 ("readline" => $self->{enabled}, sub { $self->{enabled} = shift })
14 };
15
16 ()
17}
2 18
3sub on_button_press { 19sub on_button_press {
4 my ($self, $event) = @_; 20 my ($self, $event) = @_;
5 21
6 return 22 return
7 if $self->current_screen || $self->hidden_cursor; 23 if $self->current_screen || $self->hidden_cursor || !$self->{enabled};
24
25 $termios->getattr ($self->pty_fd)
26 or return;
27
28 return
29 if $termios->getlflag & &POSIX::ICANON;
8 30
9 my ($row, $col) = $self->screen_cur; 31 my ($row, $col) = $self->screen_cur;
10 my $line = $self->line ($row); 32 my $line = $self->line ($row);
11 my $cur = $line->offset_of ($row, $col); 33 my $cur = $line->offset_of ($row, $col);
12 my $ofs = $line->offset_of ($event->{row}, $event->{col}); 34 my $ofs = $line->offset_of ($event->{row}, $event->{col});
21 } else { 43 } else {
22 $move = "\x1b[C"; 44 $move = "\x1b[C";
23 } 45 }
24 46
25 my $skipped = substr $line->t, $cur, $ofs - $cur; 47 my $skipped = substr $line->t, $cur, $ofs - $cur;
26 $skipped =~ s/$urxvt::NOCHAR//g; 48 $skipped =~ s/\x{ffff}//g;
27 49
28 $self->tt_write ($move x length $skipped); 50 $self->tt_write ($move x length $skipped);
29 } 51 }
30 52
31 () 53 ()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines