… | |
… | |
2351 | } |
2351 | } |
2352 | |
2352 | |
2353 | sub move_cursor_ver { |
2353 | sub move_cursor_ver { |
2354 | my ($self, $dy) = @_; |
2354 | my ($self, $dy) = @_; |
2355 | |
2355 | |
2356 | my ($y, $x) = $self->{layout}->index_to_line_x ($self->{cursor}); |
2356 | my ($line, $x) = $self->{layout}->index_to_line_x ($self->{cursor}); |
|
|
2357 | warn "cursor $self->{cursor} => $x $line\n";#d# |
2357 | |
2358 | |
2358 | $y += $dy; |
2359 | $line += $dy; |
2359 | |
2360 | |
2360 | if (defined (my $index = $self->{layout}->line_x_to_index ($y, $x))) { |
2361 | if (defined (my $index = $self->{layout}->line_x_to_index ($line, $x))) { |
|
|
2362 | warn "index $x $line => $index\n";#d# |
2361 | $self->{cursor} = $index; |
2363 | $self->{cursor} = $index; |
2362 | delete $self->{cur_h}; |
2364 | delete $self->{cur_h}; |
2363 | $self->update; |
2365 | $self->update; |
2364 | return; |
2366 | return; |
2365 | } |
2367 | } |