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

Comparing rxvt-unicode/src/perl/searchable-scrollback (file contents):
Revision 1.4 by root, Mon Jan 9 23:06:05 2006 UTC vs.
Revision 1.5 by root, Mon Jan 9 23:18:49 2006 UTC

65 65
66 delete $self->{in_search}; 66 delete $self->{in_search};
67} 67}
68 68
69sub search { 69sub search {
70 my ($self) = @_; 70 my ($self, $offset) = @_;
71 71
72 my $row = -$self->view_start; 72 my $row = -$self->view_start + ($self->nrow >> 1) + $offset;
73 73
74 delete $self->{found}; 74 delete $self->{found};
75 75
76 no re 'eval'; # just to be sure 76 no re 'eval'; # just to be sure
77 my $re = qr/$self->{search}/; 77 my $re = qr/$self->{search}/;
101sub refresh { 101sub refresh {
102 my ($self) = @_; 102 my ($self) = @_;
103 103
104 return unless $self->{found}; 104 return unless $self->{found};
105 105
106 $self->scr_xor_span (@$_) 106 $self->scr_xor_span (@$_, urxvt::SET_FGCOLOR (urxvt::RS_RVid, 15))
107 for @{ $self->{found} }; 107 for @{ $self->{found} };
108 108
109 () 109 ()
110} 110}
111 111
118 } elsif ($keysym == 0xff1b) { 118 } elsif ($keysym == 0xff1b) {
119 $self->view_start ($self->{in_search}); 119 $self->view_start ($self->{in_search});
120 $self->idle; 120 $self->idle;
121 } elsif ($keysym == 0xff08) { 121 } elsif ($keysym == 0xff08) {
122 substr $self->{search}, -1, 1, ""; 122 substr $self->{search}, -1, 1, "";
123
124 $self->search; 123 $self->search;
125 } elsif ($string ne "") { 124 } elsif ($string ne "") {
126 $self->{search} .= $string; 125 $self->{search} .= $string;
127
128 $self->search; 126 $self->search;
129 } 127 }
130 } else { 128 } else {
131 if ($keysym == 0xff0d || $keysym == 0xff8d) { 129 if ($keysym == 0xff0d || $keysym == 0xff8d) {
132 # OK 130 # OK
142 $self->{in_search} = $self->view_start; 140 $self->{in_search} = $self->view_start;
143 $self->search; 141 $self->search;
144 } elsif ($string eq "G") { 142 } elsif ($string eq "G") {
145 $self->view_start (0); 143 $self->view_start (0);
146 } elsif ($string eq "n") { 144 } elsif ($string eq "n") {
147 $self->search; 145 $self->search (-1);
146 $self->idle;
148 } elsif ($string eq "p") { 147 } elsif ($string eq "p") {
149 # TODO 148 # TODO
150 } elsif ($string ne "") { 149 } elsif ($string ne "") {
151 $self->scr_bell; 150 $self->scr_bell;
152 } 151 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines