… | |
… | |
1477 | } elsif ($sym == CFClient::SDLK_UP) { |
1477 | } elsif ($sym == CFClient::SDLK_UP) { |
1478 | if ($self->{history_pointer} < 0) { |
1478 | if ($self->{history_pointer} < 0) { |
1479 | $self->{history_saveback} = $self->get_text; |
1479 | $self->{history_saveback} = $self->get_text; |
1480 | } |
1480 | } |
1481 | $self->{history_pointer}++; |
1481 | $self->{history_pointer}++; |
1482 | if ($self->{history_pointer} >= @{$self->{history}}) { |
1482 | if ($self->{history_pointer} >= @{$self->{history} || []}) { |
1483 | $self->{history_pointer} = @{$self->{history}} - 1; |
1483 | $self->{history_pointer} = @{$self->{history} || []} - 1; |
1484 | } |
1484 | } |
1485 | $self->set_text ($self->{history}->[$self->{history_pointer}]); |
1485 | $self->set_text ($self->{history}->[$self->{history_pointer}]); |
1486 | |
1486 | |
1487 | } elsif ($sym == CFClient::SDLK_DOWN) { |
1487 | } elsif ($sym == CFClient::SDLK_DOWN) { |
1488 | $self->{history_pointer}--; |
1488 | $self->{history_pointer}--; |