… | |
… | |
1969 | my $mod = $ev->{mod}; |
1969 | my $mod = $ev->{mod}; |
1970 | my $sym = $ev->{sym}; |
1970 | my $sym = $ev->{sym}; |
1971 | my $uni = $ev->{unicode}; |
1971 | my $uni = $ev->{unicode}; |
1972 | |
1972 | |
1973 | my $text = $self->get_text; |
1973 | my $text = $self->get_text; |
|
|
1974 | |
|
|
1975 | $self->{cursor} = List::Util::max 0, List::Util::min $self->{cursor}, length $text; |
1974 | |
1976 | |
1975 | if ($uni == 8) { |
1977 | if ($uni == 8) { |
1976 | substr $text, --$self->{cursor}, 1, "" if $self->{cursor}; |
1978 | substr $text, --$self->{cursor}, 1, "" if $self->{cursor}; |
1977 | } elsif ($uni == 127) { |
1979 | } elsif ($uni == 127) { |
1978 | substr $text, $self->{cursor}, 1, ""; |
1980 | substr $text, $self->{cursor}, 1, ""; |