Commit 57b3f76109eb3abf03de06cbb17185038387565a

antirez 2013-02-06T12:32:42

Clarified with ctrl-t does in comments.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/linenoise.c b/linenoise.c
index 896070c..14c9855 100644
--- a/linenoise.c
+++ b/linenoise.c
@@ -503,7 +503,7 @@ static int linenoiseEdit(int fd, char *buf, size_t buflen, const char *prompt)
                 return -1;
             }
             break;
-        case 20:    /* ctrl-t */
+        case 20:    /* ctrl-t, swaps current character with previous. */
             if (l.pos > 0 && l.pos < l.len) {
                 int aux = buf[l.pos-1];
                 buf[l.pos-1] = buf[l.pos];