Skip to content

Commit

Permalink
Merge pull request antirez#41 from palikar/master
Browse files Browse the repository at this point in the history
Implementing forward\backward a word thorugh ctrl-<arrow>
  • Loading branch information
rain-1 authored Jun 13, 2019
2 parents a2d0d52 + 93459c3 commit 47acc27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions linenoise.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,11 @@ static int linenoiseEdit(int stdin_fd, int stdout_fd, char *buf, size_t buflen,
break;
}
}
else if(seq[2] == ';') {
if (read(l.ifd,seq,2) == -1) break;
if (seq[0] == '5' && seq[1] == 'C') linenoiseEditMoveWordEnd(&l);
if (seq[0] == '5' && seq[1] == 'D') linenoiseEditMoveWordStart(&l);
}
} else {
switch(seq[1]) {
case 'A': /* Up */
Expand Down

0 comments on commit 47acc27

Please sign in to comment.