mirror of https://github.com/chzyer/readline.git
Make <ctrl>+<left arrow> and <ctrl>+<right arrow> work
On many systems <ctrl>+<left arrow> and <ctrl>+<right arrow> are mapped to make the cursor move a word back and forward respectively. This is done by mapping the `\e[1;5C` and `\e[1;5D` sequences. This patch maps those sequences in this readline implementation as well.
This commit is contained in:
parent
2972be24d4
commit
faa1e4de0d
6
utils.go
6
utils.go
|
@ -102,8 +102,14 @@ func escapeExKey(key *escapeKeyPair) rune {
|
||||||
switch key.typ {
|
switch key.typ {
|
||||||
case 'D':
|
case 'D':
|
||||||
r = CharBackward
|
r = CharBackward
|
||||||
|
if key.attr == "1;5" {
|
||||||
|
r = MetaBackward
|
||||||
|
}
|
||||||
case 'C':
|
case 'C':
|
||||||
r = CharForward
|
r = CharForward
|
||||||
|
if key.attr == "1;5" {
|
||||||
|
r = MetaForward
|
||||||
|
}
|
||||||
case 'A':
|
case 'A':
|
||||||
r = CharPrev
|
r = CharPrev
|
||||||
case 'B':
|
case 'B':
|
||||||
|
|
Loading…
Reference in New Issue