lineedit: fix handling of repeating Alt-b, Alt-f, Alt-d, Alt-Backspace
authorRostislav Skudnov <rostislav@tuxera.com>
Thu, 24 Nov 2016 14:04:00 +0000 (15:04 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 24 Nov 2016 14:04:00 +0000 (15:04 +0100)
commit2e4ef38743c3d4aef109b5cc04429ec1f0e2f6c8
tree4224ad31b96cf2b03874083b80da7c4d38995817
parentcb810c48c036f50c19b08df7e161cdb0550a2abd
lineedit: fix handling of repeating Alt-b, Alt-f, Alt-d, Alt-Backspace

These key combinations should repeat correctly when the keys are
pressed and held.

Before this change, they do this erratically - many repeats are "eaten"
because they are treated as unrecognized ESC seqs:
ESC 0x7f is treated by Alt+baskspace, but ESC 0x7f ESC 0x7f ESC 0x7f
is unrecognized.

Escape sequences corresponding to these key combinations are moved from
read_line_input to lineedit_read_key.

Also, these key sequences are now enabled regardless of whether
FEATURE_EDITING_VI is set, since Vim does not actually support these key
combinations, but they are present in readline library.

function                                             old     new   delta
static.esccmds                                        93     103     +10
read_line_input                                     3737    3687     -50

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
include/libbb.h
libbb/lineedit.c
libbb/read_key.c